summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/stores
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2024-08-22 14:16:57 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2024-08-22 14:16:57 +0700
commit948914e88fa6849ec3be1cd88113dc7febeda577 (patch)
treedff43a2ee58b00566d0b3186b2a358fb560c39e2 /src-migrate/modules/product-detail/stores
parent6d302bb338e26810a7f90326b84086217f1f4ae0 (diff)
update template detail product
Diffstat (limited to 'src-migrate/modules/product-detail/stores')
-rw-r--r--src-migrate/modules/product-detail/stores/useProductDetail.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src-migrate/modules/product-detail/stores/useProductDetail.ts b/src-migrate/modules/product-detail/stores/useProductDetail.ts
index eb409930..dee6b342 100644
--- a/src-migrate/modules/product-detail/stores/useProductDetail.ts
+++ b/src-migrate/modules/product-detail/stores/useProductDetail.ts
@@ -7,6 +7,8 @@ type State = {
quantityInput: string;
askAdminUrl: string;
isApproval : boolean;
+ selectedVariant : any;
+ sla : any;
};
type Action = {
@@ -14,6 +16,8 @@ type Action = {
setQuantityInput: (value: string) => void;
setAskAdminUrl: (url: string) => void;
setIsApproval : (value : boolean) => void;
+ setSelectedVariant : (value : any) => void;
+ setSla : (value : any) => void;
};
export const useProductDetail = create<State & Action>((set, get) => ({
@@ -22,6 +26,8 @@ export const useProductDetail = create<State & Action>((set, get) => ({
quantityInput: '1',
askAdminUrl: '',
isApproval : false,
+ selectedVariant: null,
+ sla : null,
setActive: (variant) => {
set({ activeVariantId: variant?.id, activePrice: variant?.price });
},
@@ -33,5 +39,11 @@ export const useProductDetail = create<State & Action>((set, get) => ({
},
setIsApproval : (value : boolean) => {
set({ isApproval : value })
+ },
+ setSelectedVariant : (value : any) => {
+ set({ selectedVariant : value })
+ },
+ setSla : (value : any ) => {
+ set({ sla : value })
}
}));