order and refresh order page update
This commit is contained in:
@@ -204,6 +204,22 @@ const RefreshOrder = () => {
|
|||||||
}, [cityValue]);
|
}, [cityValue]);
|
||||||
|
|
||||||
const onSubmit = (value: z.infer<typeof orderForm>) => {
|
const onSubmit = (value: z.infer<typeof orderForm>) => {
|
||||||
|
if (!deliveryDate) {
|
||||||
|
toast.error('Yetkazib berish sanasini tanlang', {
|
||||||
|
richColors: true,
|
||||||
|
position: 'top-center',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selectedTimeSlot) {
|
||||||
|
toast.error('Yetkazib berish vaqtini tanlang', {
|
||||||
|
richColors: true,
|
||||||
|
position: 'top-center',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (initialValues === null) {
|
if (initialValues === null) {
|
||||||
toast.error('Savatcha bo‘sh', {
|
toast.error('Savatcha bo‘sh', {
|
||||||
richColors: true,
|
richColors: true,
|
||||||
@@ -222,6 +238,8 @@ const RefreshOrder = () => {
|
|||||||
items: items,
|
items: items,
|
||||||
long: Number(value.long),
|
long: Number(value.long),
|
||||||
lat: Number(value.lat),
|
lat: Number(value.lat),
|
||||||
|
date: formatDate.format(deliveryDate, 'YYYY-MM-DD'),
|
||||||
|
time: selectedTimeSlot,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user