feat: ingredient product
This commit is contained in:
@@ -7,6 +7,8 @@ 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'
|
||||
import organizationReducer from '@/redux-store/slices/organization'
|
||||
import userReducer from '@/redux-store/slices/user'
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
@@ -15,7 +17,9 @@ export const store = configureStore({
|
||||
paymentMethodReducer,
|
||||
ingredientReducer,
|
||||
orderReducer,
|
||||
productRecipeReducer
|
||||
productRecipeReducer,
|
||||
organizationReducer,
|
||||
userReducer
|
||||
},
|
||||
middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false })
|
||||
})
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// Third-party Imports
|
||||
import type { PayloadAction } from '@reduxjs/toolkit'
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
// Type Imports
|
||||
|
||||
// Data Imports
|
||||
import { Organization } from '../../types/services/organization'
|
||||
|
||||
const initialState: { currentOrganization: Organization } = {
|
||||
currentOrganization: {
|
||||
id: '',
|
||||
name: '',
|
||||
email: '',
|
||||
phone_number: '',
|
||||
plan_type: 'basic',
|
||||
created_at: '',
|
||||
updated_at: ''
|
||||
}
|
||||
}
|
||||
|
||||
export const organizationSlice = createSlice({
|
||||
name: 'organization',
|
||||
initialState,
|
||||
reducers: {
|
||||
setOrganization: (state, action: PayloadAction<Organization>) => {
|
||||
state.currentOrganization = action.payload
|
||||
},
|
||||
resetOrganization: state => {
|
||||
state.currentOrganization = initialState.currentOrganization
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setOrganization, resetOrganization } = organizationSlice.actions
|
||||
|
||||
export default organizationSlice.reducer
|
||||
@@ -0,0 +1,40 @@
|
||||
// Third-party Imports
|
||||
import type { PayloadAction } from '@reduxjs/toolkit'
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
// Type Imports
|
||||
|
||||
// Data Imports
|
||||
import { User } from '../../types/services/user'
|
||||
|
||||
const initialState: { currentUser: User } = {
|
||||
currentUser: {
|
||||
id: '',
|
||||
organization_id: '',
|
||||
outlet_id: '',
|
||||
name: '',
|
||||
email: '',
|
||||
role: '',
|
||||
permissions: {},
|
||||
is_active: false,
|
||||
created_at: '',
|
||||
updated_at: ''
|
||||
}
|
||||
}
|
||||
|
||||
export const userSlice = createSlice({
|
||||
name: 'user',
|
||||
initialState,
|
||||
reducers: {
|
||||
setUser: (state, action: PayloadAction<User>) => {
|
||||
state.currentUser = action.payload
|
||||
},
|
||||
resetUser: state => {
|
||||
state.currentUser = initialState.currentUser
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const { setUser, resetUser } = userSlice.actions
|
||||
|
||||
export default userSlice.reducer
|
||||
Reference in New Issue
Block a user