feat(layout): Update frontend types and API to support Tiers
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s

- Added 'tiers' to LayoutSection
- Added 'tier' to LayoutPosition
- Included 'sections' in saveFloorLayout payload (fixes data loss bug)
This commit is contained in:
fullsizemalt 2025-12-11 13:24:56 -08:00
parent ed36645cc8
commit 2edb2dd100

View file

@ -50,6 +50,7 @@ export interface LayoutPosition {
sectionId: string;
row: number;
column: number;
tier: number;
slot: number;
status: string;
plantId?: string;
@ -68,6 +69,7 @@ export interface LayoutSection {
height: number;
rows: number;
columns: number;
tiers: number;
spacing?: number;
positions?: LayoutPosition[];
}
@ -124,7 +126,8 @@ export const layoutApi = {
width: r.width,
height: r.height,
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 });
return response.data;