fix: backend syntax and frontend toast API
This commit is contained in:
parent
a13d6f6907
commit
2bc596c527
2 changed files with 547 additions and 551 deletions
|
|
@ -713,10 +713,6 @@ export async function layoutRoutes(fastify: FastifyInstance, options: FastifyPlu
|
|||
return reply.status(500).send({ error: 'Failed to move plant' });
|
||||
}
|
||||
}
|
||||
};
|
||||
} catch (error) {
|
||||
fastify.log.error(error);
|
||||
return reply.status(500).send({ error: 'Failed to move plant' });
|
||||
});
|
||||
|
||||
// Update Plant (Tag, Notes)
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export function LayoutEditor({ floorId, className }: LayoutEditorProps) {
|
|||
if (newTag && newTag !== selectedSlot.plant?.tagNumber) {
|
||||
layoutApi.updatePlant(selectedSlot.plant!.id, { tagNumber: newTag })
|
||||
.then(() => {
|
||||
toast({ title: 'Tag Updated', description: newTag });
|
||||
toast.info('Tag Updated', { description: newTag });
|
||||
reloadFloorData();
|
||||
setSelectedSlot(prev => prev ? ({ ...prev, plant: { ...prev.plant!, tagNumber: newTag } }) : null);
|
||||
});
|
||||
|
|
@ -319,7 +319,7 @@ export function LayoutEditor({ floorId, className }: LayoutEditorProps) {
|
|||
<div className="grid grid-cols-2 gap-3">
|
||||
<button
|
||||
className="py-2.5 bg-secondary hover:bg-secondary/80 text-foreground border border-border text-sm rounded-lg transition-colors font-medium flex items-center justify-center gap-2"
|
||||
onClick={() => toast({ title: 'Move Plant', description: 'Drag and drop plants on the grid to move them.' })}
|
||||
onClick={() => toast.info('Move Plant', { description: 'Drag and drop plants on the grid to move them.' })}
|
||||
>
|
||||
<Move className="w-4 h-4" /> Move
|
||||
</button>
|
||||
|
|
@ -362,7 +362,7 @@ export function LayoutEditor({ floorId, className }: LayoutEditorProps) {
|
|||
)}
|
||||
<button
|
||||
className="col-span-2 py-2.5 bg-primary hover:bg-primary-hover text-primary-foreground font-medium text-sm rounded-lg shadow-sm transition-all flex items-center justify-center gap-2"
|
||||
onClick={() => toast({ title: 'Compliance', description: 'Opening compliance manager...' })}
|
||||
onClick={() => toast.info('Compliance', { description: 'Opening compliance manager...' })}
|
||||
>
|
||||
<ShieldCheck className="w-4 h-4" /> Manage Compliance
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue