forked from jappel/leistungsbilanz-ts
Persist distribution board setup
This commit is contained in:
parent
1a77eedaa8
commit
1cf26a932e
21 changed files with 1027 additions and 22 deletions
|
|
@ -87,6 +87,11 @@ export interface DistributionBoardDto {
|
|||
name: string;
|
||||
}
|
||||
|
||||
export interface DistributionBoardCommandResultDto
|
||||
extends ProjectCommandResultDto {
|
||||
distributionBoard: DistributionBoardDto;
|
||||
}
|
||||
|
||||
export interface CircuitListDto {
|
||||
id: string;
|
||||
projectId: string;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import type {
|
|||
CreateRoomInput,
|
||||
CreateGlobalDeviceInput,
|
||||
DistributionBoardDto,
|
||||
DistributionBoardCommandResultDto,
|
||||
FloorDto,
|
||||
GlobalDeviceDto,
|
||||
ProjectCommandDto,
|
||||
|
|
@ -222,11 +223,18 @@ export function listDistributionBoards(projectId: string) {
|
|||
return request<DistributionBoardDto[]>(`/api/projects/${projectId}/distribution-boards`);
|
||||
}
|
||||
|
||||
export function createDistributionBoard(projectId: string, name: string) {
|
||||
return request<DistributionBoardDto>(`/api/projects/${projectId}/distribution-boards`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ name }),
|
||||
});
|
||||
export function createDistributionBoard(
|
||||
projectId: string,
|
||||
name: string,
|
||||
expectedRevision: number
|
||||
) {
|
||||
return request<DistributionBoardCommandResultDto>(
|
||||
`/api/projects/${projectId}/distribution-boards`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({ name, expectedRevision }),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function listCircuitLists(projectId: string) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ const commandTypeLabels: Record<string, string> = {
|
|||
"project-device.delete": "Projektgerät gelöscht",
|
||||
"project-device.sync-rows": "Projektgerät-Verknüpfungen geändert",
|
||||
"project.update-settings": "Projekteinstellungen bearbeitet",
|
||||
"distribution-board.insert": "Verteilung angelegt",
|
||||
"distribution-board.delete": "Verteilung entfernt",
|
||||
"project.restore-state": "Projektstand wiederhergestellt",
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue