Sorting API #
Base path: /sorting
POST /sorting/change
Changes the position of a row within a table by updating its sorting order.
Description:
This endpoint moves a row to a new position based on another row’s position.
It automatically adjusts the sorting values of affected rows to maintain correct ordering.
Behavior:
- Finds the current position of the item to move
- Finds the target position
- Shifts other rows up or down accordingly
- Updates the moved row to its new position
Possible errors:
- 404: Table does not exist
- 404: Invalid ID (row not found)
- 422: Validation error (missing or invalid IDs)
Notes:
The table must contain a sorting column.
Both IDs must exist in the same table.
The endpoint dynamically works with any table name provided.
