Patch will be processed after Put transmission.
export const EditProps = ({ items, id, point }: IEditPageProps) => {
const [itemsState, setItemsState] = useState(items)
const [pointState, setPointState] = useState(point)
const {
register,
handleSubmit,
refineCore: { onFinish },
} = useForm<TermValues, HttpError, TermValues>({
shouldUseNativeValidation: true,
refineCoreProps: {
resource: 'customergroups',
action: 'edit',
id: id,
},
})
const apiUrl = process.env.NEXT_PUBLIC_CAFE24_API_URL
const onSubmit = async () => {
const combinedState = { ...itemsState, ...pointState }
await axios.put(
return onFinish(itemsState)
}
const [itemsState, setItemsState] = useState(items)
const [pointState, setPointState] = useState(point)
const {
register,
handleSubmit,
refineCore: { onFinish },
} = useForm<TermValues, HttpError, TermValues>({
shouldUseNativeValidation: true,
refineCoreProps: {
resource: 'customergroups',
action: 'edit',
id: id,
},
})
const apiUrl = process.env.NEXT_PUBLIC_CAFE24_API_URL
const onSubmit = async () => {
const combinedState = { ...itemsState, ...pointState }
await axios.put(
${apiUrl}/customergroups/${id}, combinedState).then((res) => res.data)return onFinish(itemsState)
}
