order and refresh order page update

This commit is contained in:
Samandar Turgunboyev
2025-12-26 17:13:34 +05:00
parent 7464ec9768
commit ec488f09fe

View File

@@ -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 bosh', { toast.error('Savatcha bosh', {
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,
}); });
}; };