mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-15 19:28:52 +02:00
feat(grid): implement product streaming with JSON chunks for grid client
This commit is contained in:
1 parent
8809819658
commit
e6f40d3d81
13 files changed
+580
-98
No files matched your search
@@ -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 };
|
||||
}
|
||||
Reference in new issue
Block a user