feat: Add shop ID slice to store configuration

This commit is contained in:
ALi Josheghani
2024-10-30 11:33:00 +03:30
parent b853d7df01
commit aca1dd53ad

View File

@@ -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<string>) => {
state.shop_id = action.payload;
},
},
});
export const { setShopId } = shopIdSlice.actions;
export default shopIdSlice.reducer;