From aca1dd53adcf05e6e9e8c7986bd3c7ffca8420e8 Mon Sep 17 00:00:00 2001 From: ALi Josheghani Date: Wed, 30 Oct 2024 11:33:00 +0330 Subject: [PATCH] feat: Add shop ID slice to store configuration --- src/redux/slices/shop-id.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/redux/slices/shop-id.ts diff --git a/src/redux/slices/shop-id.ts b/src/redux/slices/shop-id.ts new file mode 100644 index 0000000..6e56f77 --- /dev/null +++ b/src/redux/slices/shop-id.ts @@ -0,0 +1,26 @@ +// src/slices/token.ts +import { createSlice, PayloadAction } from "@reduxjs/toolkit"; + +// Initial type for the token state +interface ShopIdState { + shop_id: string; +} + +// Initial value for the token state +const initialState: ShopIdState = { + shop_id: "", +}; + +const shopIdSlice = createSlice({ + name: "shop-id", + initialState, + reducers: { + setShopId: (state, action: PayloadAction) => { + state.shop_id = action.payload; + }, + }, +}); + +export const { setShopId } = shopIdSlice.actions; + +export default shopIdSlice.reducer;