mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 17:10:56 +00:00
add permanent purge functionality for wagons and routes
- Implemented a method in to permanently delete wagons without history. - Added corresponding permissions for hard delete actions in . - Updated the UI components to include purge actions, ensuring they are only available to users with the appropriate permissions. - Created modals for confirming permanent deletions in and . - Enhanced API services to handle purge requests for locomotives, wagons, and routes. - Added tests for the purge functionality in both and services to ensure proper behavior and error handling.
This commit is contained in:
@@ -1605,6 +1605,15 @@ export const api = {
|
||||
undefined,
|
||||
() => [["routes"]],
|
||||
),
|
||||
|
||||
/** Irreversible purge — refused while any train schedule uses the route. */
|
||||
purge: endpoint<string, void>(
|
||||
"routes",
|
||||
"purge",
|
||||
(id) => routesService.purge(id).then(() => undefined),
|
||||
undefined,
|
||||
() => [["routes"]],
|
||||
),
|
||||
},
|
||||
|
||||
stations: {
|
||||
@@ -2194,6 +2203,15 @@ export const api = {
|
||||
undefined,
|
||||
({ slug }) => [QUERY_KEYS.FLEET.list(slug)],
|
||||
),
|
||||
|
||||
/** Irreversible purge — locomotives and wagons only. */
|
||||
purge: endpoint<{ slug: FleetResourceSlug; id: string }, unknown>(
|
||||
"fleet",
|
||||
"purge",
|
||||
({ slug, id }) => fleetService.purge(slug, id),
|
||||
undefined,
|
||||
({ slug }) => [QUERY_KEYS.FLEET.list(slug)],
|
||||
),
|
||||
},
|
||||
|
||||
truckTypes: {
|
||||
|
||||
Reference in New Issue
Block a user