forked from jappel/leistungsbilanz-ts
Move circuits between groups
This commit is contained in:
parent
be9c6f0d52
commit
93ec294759
6 changed files with 336 additions and 21 deletions
|
|
@ -65,6 +65,9 @@ import type {
|
|||
import type {
|
||||
CircuitGroupRenumberPlan,
|
||||
} from "../../domain/services/circuit-group-renumbering";
|
||||
import type {
|
||||
CircuitGroupMovePlan,
|
||||
} from "../../domain/services/circuit-group-move-planning";
|
||||
|
||||
async function request<T>(url: string, init?: RequestInit): Promise<T> {
|
||||
const response = await fetch(url, {
|
||||
|
|
@ -473,6 +476,23 @@ export function renumberCircuitGroupsCommand(
|
|||
);
|
||||
}
|
||||
|
||||
export function moveCircuitToGroupCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
plan: CircuitGroupMovePlan
|
||||
) {
|
||||
return executeProjectCommand(
|
||||
projectId,
|
||||
expectedRevision,
|
||||
{
|
||||
schemaVersion: 1,
|
||||
type: "circuit.move-group",
|
||||
payload: plan,
|
||||
},
|
||||
"Stromkreis in andere Gruppe verschieben"
|
||||
);
|
||||
}
|
||||
|
||||
export function updateCircuitProtectionCommand(
|
||||
projectId: string,
|
||||
expectedRevision: number,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue