fix date
This commit is contained in:
@@ -14,6 +14,7 @@ import { toast } from 'react-toastify'
|
|||||||
import { ErrorType } from '../../../helpers/types'
|
import { ErrorType } from '../../../helpers/types'
|
||||||
import { TickCircle } from 'iconsax-react'
|
import { TickCircle } from 'iconsax-react'
|
||||||
import { Pages } from '../../../config/Pages'
|
import { Pages } from '../../../config/Pages'
|
||||||
|
import moment from 'moment-jalaali'
|
||||||
|
|
||||||
const UpdateRestaurant: FC = () => {
|
const UpdateRestaurant: FC = () => {
|
||||||
|
|
||||||
@@ -40,8 +41,18 @@ const UpdateRestaurant: FC = () => {
|
|||||||
onSubmit: (values) => {
|
onSubmit: (values) => {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
|
|
||||||
|
const params: UpdateRestaurantType = {
|
||||||
|
...values,
|
||||||
|
subscriptionStartDate: values.subscriptionStartDate
|
||||||
|
? moment(values.subscriptionStartDate, 'jYYYY/jMM/jDD').format('YYYY-MM-DD')
|
||||||
|
: undefined,
|
||||||
|
subscriptionEndDate: values.subscriptionEndDate
|
||||||
|
? moment(values.subscriptionEndDate, 'jYYYY/jMM/jDD').format('YYYY-MM-DD')
|
||||||
|
: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
updateRestaurant.mutate(
|
updateRestaurant.mutate(
|
||||||
{ id, params: values },
|
{ id, params },
|
||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast.success(t('success'))
|
toast.success(t('success'))
|
||||||
|
|||||||
Reference in New Issue
Block a user