Soft mass action

I am currently working on a restful-API for an existing product and am facing a rather complex problem: The existing application supports several bulk actions, i.e. Bulk delete or grids to bulk define specific record properties. Using a regular restful-pattern, I have to send an api-call for each record (DELETE or UPDATE), but with a lot of records this will obviously be rather slow. so I was wondering if someone had already found a good solution for this, especially regarding use with existing soothing technology (like in the Extjs restful store). So far, if you come up with these possible solutions:

  • Forcing my backup controllers to use the reserved parameter ("_requests" or something else) as an array and matching each element with one call inside.
  • using a separate controller for every bulk action I want. This seems cleaner, but much more work, both on the backend and on the application using the API.

Any thoughts?

+3
source share
1 answer

RESTful actions act on resources, so the URI might refer to the collection (even describing the collection, if necessary) and publish the deletion with that URI. In RESTful terms, you are transferring a collection resource remotely to your URI. So:

Delete -> stub / collections / ids = 141,159,235,900

+2
source

Source: https://habr.com/ru/post/1794099/


All Articles