- Implemented CuttingIndex component for listing and managing cuttings. - Added routes for cutting management in web.php. - Created CuttingTest for testing cutting-related features including authorization, validation, and stock management. - Updated roles create and edit pages to include necessary imports. - Refactored settings and profile pages to streamline imports. - Enhanced permissions checks for cutting management actions.
21 lines
521 B
TypeScript
21 lines
521 B
TypeScript
import { useDraftSave } from '@/hooks/use-draft-save';
|
|
import { clearCuttingDraft, saveCuttingDraft } from '@/lib/cutting-draft';
|
|
import type { CuttingDraftData } from '@/lib/cutting-draft';
|
|
|
|
type DraftType = 'create' | 'edit';
|
|
|
|
export function useCuttingDraftSave(
|
|
type: DraftType,
|
|
data: CuttingDraftData,
|
|
userId?: number,
|
|
delay = 500,
|
|
) {
|
|
return useDraftSave({
|
|
type,
|
|
data,
|
|
userId,
|
|
delay,
|
|
store: { save: saveCuttingDraft, clear: clearCuttingDraft },
|
|
});
|
|
}
|