Delete populated circuit groups safely
This commit is contained in:
@@ -68,6 +68,9 @@ import type {
|
||||
import type {
|
||||
CircuitGroupMovePlan,
|
||||
} from "../../domain/services/circuit-group-move-planning";
|
||||
import type {
|
||||
CircuitGroupSubtreeSnapshot,
|
||||
} from "../../domain/models/circuit-group-subtree-snapshot.model";
|
||||
|
||||
async function request<T>(url: string, init?: RequestInit): Promise<T> {
|
||||
const response = await fetch(url, {
|
||||
@@ -440,6 +443,23 @@ export function deleteCircuitGroupCommand(
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteCircuitGroupSubtreeCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
snapshot: CircuitGroupSubtreeSnapshot
|
||||
) {
|
||||
return executeProjectCommand(
|
||||
projectId,
|
||||
expectedRevision,
|
||||
{
|
||||
schemaVersion: 1,
|
||||
type: "circuit-group.delete-subtree",
|
||||
payload: { snapshot },
|
||||
},
|
||||
"Befüllte Stromkreisgruppe entfernen"
|
||||
);
|
||||
}
|
||||
|
||||
export function reorderCircuitGroupsCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
|
||||
Reference in New Issue
Block a user