Renumber circuit groups explicitly
This commit is contained in:
parent
0cb280ddb2
commit
be9c6f0d52
6 changed files with 347 additions and 1 deletions
|
|
@ -62,6 +62,9 @@ import type {
|
|||
import type {
|
||||
CircuitProtectionSnapshot,
|
||||
} from "../../domain/models/circuit-protection-project-command.model";
|
||||
import type {
|
||||
CircuitGroupRenumberPlan,
|
||||
} from "../../domain/services/circuit-group-renumbering";
|
||||
|
||||
async function request<T>(url: string, init?: RequestInit): Promise<T> {
|
||||
const response = await fetch(url, {
|
||||
|
|
@ -452,6 +455,24 @@ export function reorderCircuitGroupsCommand(
|
|||
);
|
||||
}
|
||||
|
||||
export function renumberCircuitGroupsCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
circuitListId: string,
|
||||
plan: CircuitGroupRenumberPlan
|
||||
) {
|
||||
return executeProjectCommand(
|
||||
projectId,
|
||||
expectedRevision,
|
||||
{
|
||||
schemaVersion: 1,
|
||||
type: "circuit-group.renumber",
|
||||
payload: { circuitListId, groups: plan.groups },
|
||||
},
|
||||
"Stromkreisgruppen neu nummerieren"
|
||||
);
|
||||
}
|
||||
|
||||
export function updateCircuitProtectionCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue