added tour
This commit is contained in:
@@ -43,7 +43,7 @@ const formSchema = z.object({
|
||||
title: z.string().min(2, {
|
||||
message: "Sarlavha kamida 2 ta belgidan iborat bo'lishi kerak",
|
||||
}),
|
||||
rating: z.number().min(1).max(5),
|
||||
rating: z.string().min(1).max(5),
|
||||
mealPlan: z.string().min(1, { message: "Taom rejasi tanlanishi majburiy" }),
|
||||
hotelType: z
|
||||
.array(z.string())
|
||||
@@ -71,7 +71,7 @@ const StepTwo = ({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
title: "",
|
||||
rating: 3.0,
|
||||
rating: "3.0",
|
||||
mealPlan: "",
|
||||
hotelType: [],
|
||||
hotelFeatures: [],
|
||||
@@ -84,7 +84,7 @@ const StepTwo = ({
|
||||
const tourData = data.data;
|
||||
|
||||
form.setValue("title", tourData.hotel_name);
|
||||
form.setValue("rating", Number(tourData.hotel_rating));
|
||||
form.setValue("rating", tourData.hotel_rating);
|
||||
form.setValue("mealPlan", tourData.hotel_meals);
|
||||
}
|
||||
}, [isEditMode, data, form]);
|
||||
|
||||
Reference in New Issue
Block a user