feat: Add shop ID slice to store configuration
This commit is contained in:
26
src/redux/slices/shop-id.ts
Normal file
26
src/redux/slices/shop-id.ts
Normal 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;
|
||||
Reference in New Issue
Block a user