summaryrefslogtreecommitdiff
path: root/src-migrate/modules/register/stores
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-31 13:58:23 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-31 13:58:23 +0700
commitb5701645ce23deed5e32afc4a0f98bd523c6c92c (patch)
tree4dbaa7c968246a0ebfd1777f5b8d2575461b7544 /src-migrate/modules/register/stores
parentdaaf32f9dd3af860013b70d04c89f4cca84724b1 (diff)
<iman> update pengajuan tempo
Diffstat (limited to 'src-migrate/modules/register/stores')
-rw-r--r--src-migrate/modules/register/stores/usePengajuanTempoStore.ts28
1 files changed, 10 insertions, 18 deletions
diff --git a/src-migrate/modules/register/stores/usePengajuanTempoStore.ts b/src-migrate/modules/register/stores/usePengajuanTempoStore.ts
index be5a3e45..47168a2a 100644
--- a/src-migrate/modules/register/stores/usePengajuanTempoStore.ts
+++ b/src-migrate/modules/register/stores/usePengajuanTempoStore.ts
@@ -355,6 +355,7 @@ export const usePengajuanTempoStoreDokumen = create<
}));
type StateSupplier = {
+ hasSavedata: boolean;
formSupplier: TempoPropsSupplier[];
errorsSupplier: {
[key in keyof TempoPropsSupplier]?: string;
@@ -362,33 +363,24 @@ type StateSupplier = {
};
type ActionSupplier = {
updateFormSupplier: (data: TempoPropsSupplier[]) => void;
-
+ updateHasSave: (data: boolean) => void;
validateSupplier: () => void;
};
export const usePengajuanTempoStoreSupplier = create<
StateSupplier & ActionSupplier
>((set, get) => ({
formSupplier: [],
+ hasSavedata: false,
updateFormSupplier: (data) => {
set(() => ({
- formSupplier: data, // Menyimpan data baru ke dalam formSupplier
+ formSupplier: data,
}));
},
-
- errorsSupplier: {},
- validateSupplier: () => {
- // try {
- // TempoSchemaSupplier.parse(get().formSupplier);
- // set({ errorsSupplier: {} });
- // } catch (error) {
- // if (error instanceof ZodError) {
- // const errorsSupplier: StateSupplier['errorsSupplier'] = {};
- // error.errors.forEach(
- // (e) =>
- // (errorsSupplier[e.path[0] as keyof TempoPropsSupplier] = e.message)
- // );
- // set({ errorsSupplier });
- // }
- // }
+ updateHasSave: (data) => {
+ set(() => ({
+ hasSavedata: data,
+ }));
},
+ errorsSupplier: {},
+ validateSupplier: () => {},
}));