efril #7

Merged
aefril merged 23 commits from efril into main 2025-09-12 21:12:53 +00:00
3 changed files with 47 additions and 2 deletions
Showing only changes of commit c91be1812b - Show all commits

View File

@ -9,6 +9,7 @@ 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'
import vendorReducer from '@/redux-store/slices/vendor'
export const store = configureStore({
reducer: {
@ -19,7 +20,8 @@ export const store = configureStore({
orderReducer,
productRecipeReducer,
organizationReducer,
userReducer
userReducer,
vendorReducer
},
middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: false })
})

View File

@ -0,0 +1,43 @@
// Third-party Imports
import type { PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'
// Type Imports
// Data Imports
import { Vendor } from '../../types/services/vendor'
const initialState: { currentVendor: Vendor } = {
currentVendor: {
id: '',
organization_id: '',
name: '',
email: '',
phone_number: '',
address: '',
contact_person: '',
tax_number: '',
payment_terms: '',
notes: '',
is_active: true,
created_at: '',
updated_at: ''
}
}
export const VendorSlice = createSlice({
name: 'vendor',
initialState,
reducers: {
setVendor: (state, action: PayloadAction<Vendor>) => {
state.currentVendor = action.payload
},
resetVendor: state => {
state.currentVendor = initialState.currentVendor
}
}
})
export const { setVendor, resetVendor } = VendorSlice.actions
export default VendorSlice.reducer

View File

@ -184,7 +184,7 @@ const VendorListTable = () => {
<div className='flex items-center gap-4'>
<div className='flex flex-col'>
<Link href={getLocalizedUrl(`/apps/vendor/detail`, locale as Locale)}>
<Typography color='primary' className='font-medium cursor-pointer hover:underline'>
<Typography className='font-medium cursor-pointer hover:underline text-primary'>
{row.original.contact_person}
</Typography>
</Link>