feat(layout): Update frontend types and API to support Tiers
- Added 'tiers' to LayoutSection - Added 'tier' to LayoutPosition - Included 'sections' in saveFloorLayout payload (fixes data loss bug)
This commit is contained in:
parent
ed36645cc8
commit
2edb2dd100
1 changed files with 4 additions and 1 deletions
|
|
@ -50,6 +50,7 @@ export interface LayoutPosition {
|
||||||
sectionId: string;
|
sectionId: string;
|
||||||
row: number;
|
row: number;
|
||||||
column: number;
|
column: number;
|
||||||
|
tier: number;
|
||||||
slot: number;
|
slot: number;
|
||||||
status: string;
|
status: string;
|
||||||
plantId?: string;
|
plantId?: string;
|
||||||
|
|
@ -68,6 +69,7 @@ export interface LayoutSection {
|
||||||
height: number;
|
height: number;
|
||||||
rows: number;
|
rows: number;
|
||||||
columns: number;
|
columns: number;
|
||||||
|
tiers: number;
|
||||||
spacing?: number;
|
spacing?: number;
|
||||||
positions?: LayoutPosition[];
|
positions?: LayoutPosition[];
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +126,8 @@ export const layoutApi = {
|
||||||
width: r.width,
|
width: r.width,
|
||||||
height: r.height,
|
height: r.height,
|
||||||
color: r.color,
|
color: r.color,
|
||||||
rotation: r.rotation
|
rotation: r.rotation,
|
||||||
|
sections: r.sections // Include sections in save
|
||||||
}));
|
}));
|
||||||
const response = await api.post(`/api/layout/floors/${floorId}/layout`, { rooms: roomsForApi });
|
const response = await api.post(`/api/layout/floors/${floorId}/layout`, { rooms: roomsForApi });
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue