diff --git a/admin/pages/restaurants/add/index.tsx b/admin/pages/restaurants/add/index.tsx index a0baf4d..3cf9d41 100644 --- a/admin/pages/restaurants/add/index.tsx +++ b/admin/pages/restaurants/add/index.tsx @@ -22,6 +22,11 @@ const AddRestaurantPage = () => { const [name, setName] = useState(null); const [description, setDescription] = useState(null); const [address, setAddress] = useState(null); + const [localArea, setLocalArea] = useState(""); + const [city, setCity] = useState(""); + const [state, setState] = useState(""); + const [postalCode, setPostalCode] = useState(0); + const [country, setCountry] = useState("India"); const [phone, setPhone] = useState(""); const [tags, setTags] = useState([]); const [isPublic, setIsPublic] = useState(true); @@ -44,6 +49,11 @@ const AddRestaurantPage = () => { name: z.string().min(3), description: z.string().min(5), address: z.string().min(10), + local_area: z.string().min(3), + city: z.string().min(3), + state: z.string().min(3), + postal_code: z.number().positive().min(5), + country: z.string().min(3), images: z .array(z.string().min(10)) .min(1, { message: "Images is required" }), @@ -75,6 +85,11 @@ const AddRestaurantPage = () => { name: name, description: description, address: address, + local_area: localArea, + city: city, + state: state, + postal_code: postalCode, + country: country, images: images, phone: parseInt(phone), tags: tags, @@ -98,6 +113,11 @@ const AddRestaurantPage = () => { name: name, description: description, address: address, + local_area: localArea, + city: city, + state: state, + postal_code: postalCode, + country: country, images: images, phone: parseInt(phone), tags: tags.map((tag) => tag.toLowerCase()), @@ -213,6 +233,99 @@ const AddRestaurantPage = () => { {errors.find((error) => error.for === "address")?.message} +
+
+ +
+ setLocalArea(e.target.value)} + /> +
+
+ {errors.find((error) => error.for === "localArea")?.message} +
+
+ +
+ + setCity(e.target.value as any)} + /> +
+ {errors.find((error) => error.for === "city")?.message} +
+
+
+
+
+ +
+ setState(e.target.value)} + /> +
+
+ {errors.find((error) => error.for === "state")?.message} +
+
+ +
+ + setPostalCode(parseInt(e.target.value))} + /> +
+ {errors.find((error) => error.for === "postalCode")?.message} +
+
+
+
+ +
+ setCountry(e.target.value)} + /> +
+
+ {errors.find((error) => error.for === "country")?.message} +
+