feat: product recipes
This commit is contained in:
@@ -6,6 +6,7 @@ import customerReducer from '@/redux-store/slices/customer'
|
||||
import paymentMethodReducer from '@/redux-store/slices/paymentMethod'
|
||||
import ingredientReducer from '@/redux-store/slices/ingredient'
|
||||
import orderReducer from '@/redux-store/slices/order'
|
||||
import productRecipeReducer from '@/redux-store/slices/productRecipe'
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
@@ -13,7 +14,8 @@ export const store = configureStore({
|
||||
customerReducer,
|
||||
paymentMethodReducer,
|
||||
ingredientReducer,
|
||||
orderReducer
|
||||
orderReducer,
|
||||
productRecipeReducer
|
||||
},
|
||||
middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false })
|
||||
})
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// Third-party Imports
|
||||
import type { PayloadAction } from '@reduxjs/toolkit'
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
// Type Imports
|
||||
|
||||
// Data Imports
|
||||
|
||||
const initialState: { currentProductRecipe: any } = {
|
||||
currentProductRecipe: {}
|
||||
}
|
||||
|
||||
export const productRecipeSlice = createSlice({
|
||||
name: 'productRecipe',
|
||||
initialState,
|
||||
reducers: {
|
||||
setProductRecipe: (state, action: PayloadAction<any>) => {
|
||||
state.currentProductRecipe = action.payload
|
||||
},
|
||||
resetProductRecipe: state => {
|
||||
state.currentProductRecipe = initialState.currentProductRecipe
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setProductRecipe, resetProductRecipe } = productRecipeSlice.actions
|
||||
|
||||
export default productRecipeSlice.reducer
|
||||
Reference in New Issue
Block a user