order and refresh order page update
This commit is contained in:
@@ -204,6 +204,22 @@ const RefreshOrder = () => {
|
||||
}, [cityValue]);
|
||||
|
||||
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) {
|
||||
toast.error('Savatcha bo‘sh', {
|
||||
richColors: true,
|
||||
@@ -222,6 +238,8 @@ const RefreshOrder = () => {
|
||||
items: items,
|
||||
long: Number(value.long),
|
||||
lat: Number(value.lat),
|
||||
date: formatDate.format(deliveryDate, 'YYYY-MM-DD'),
|
||||
time: selectedTimeSlot,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user