Compare commits

..

No commits in common. "0528cfa053bd5af58317e64120eabc8ced7fad90" and "17f059f09da735e870a5963d9df3423daf43ba00" have entirely different histories.

2 changed files with 19 additions and 21 deletions

View File

@ -26,7 +26,7 @@ import '@/libs/styles/tiptapEditor.css'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { RootState } from '../../../../../redux-store' import { RootState } from '../../../../../redux-store'
import { resetProduct, setProduct, setProductField } from '@/redux-store/slices/product' import { setProduct, setProductField } from '@/redux-store/slices/product'
import { useEffect } from 'react' import { useEffect } from 'react'
import { useParams } from 'next/navigation' import { useParams } from 'next/navigation'
import { useProductById } from '../../../../../services/queries/products' import { useProductById } from '../../../../../services/queries/products'
@ -133,8 +133,6 @@ const ProductInformation = () => {
const isEdit = !!params?.id const isEdit = !!params?.id
useEffect(() => { useEffect(() => {
if (params?.id) {
// Mode edit → set product dari API
if (product) { if (product) {
dispatch( dispatch(
setProduct({ setProduct({
@ -150,10 +148,7 @@ const ProductInformation = () => {
}) })
) )
} }
} else { }, [product, dispatch])
dispatch(resetProduct())
}
}, [params?.id, product, dispatch])
const handleInputChange = (field: any, value: any) => { const handleInputChange = (field: any, value: any) => {
dispatch(setProductField({ field, value })) dispatch(setProductField({ field, value }))

View File

@ -73,6 +73,9 @@ const ProductOrganize = () => {
/> />
)} )}
/> />
<CustomIconButton variant='tonal' color='primary' className='min-is-fit'>
<i className='tabler-plus' />
</CustomIconButton>
</div> </div>
<CustomTextField <CustomTextField
select select