feat(grid): implement product streaming with JSON chunks for grid client

This commit is contained in:
Michael committed 2026-05-26 13:31:26 +02:00
1 parent 8809819658
commit e6f40d3d81
13 files changed
+580 -98

No files matched your search

+6 -2
View File
@@ -10,7 +10,11 @@ import { GammeCode } from "@/types/grid";
* Filters changes to only include those in the provided codeins list (e.g. current supplier).
*/
export function useSaveDrafts(magasin: string, filterCodeins?: string[]) {
const { draftChanges, rows, resetDrafts, clearDrafts, applyDraftsToRows } = useGridStore();
const draftChanges = useGridStore((s) => s.draftChanges);
const rows = useGridStore((s) => s.rows);
const resetDrafts = useGridStore((s) => s.resetDrafts);
const clearDrafts = useGridStore((s) => s.clearDrafts);
const applyDraftsToRows = useGridStore((s) => s.applyDraftsToRows);
// Only consider changes that are in the filter list (if provided)
const activeDrafts = filterCodeins
@@ -49,7 +53,7 @@ export function useSaveDrafts(magasin: string, filterCodeins?: string[]) {
}
}
return result;
}, [activeDrafts, rows, magasin, resetDrafts, clearDrafts, filterCodeins]);
}, [activeDrafts, rows, magasin, resetDrafts, clearDrafts, applyDraftsToRows, filterCodeins]);
return { save, hasDrafts: count > 0, count };
}