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]);
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 bosh', {
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,
});
};