bug fix
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { getDetailAgency, updateAgencyStatus } from "@/pages/agencies/lib/api";
|
import { getDetailAgency, updateAgencyStatus } from "@/pages/agencies/lib/api";
|
||||||
import formatPhone from "@/shared/lib/formatPhone";
|
import formatPhone from "@/shared/lib/formatPhone";
|
||||||
|
import onlyNumber from "@/shared/lib/onlyNumber";
|
||||||
import { Button } from "@/shared/ui/button";
|
import { Button } from "@/shared/ui/button";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/shared/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/shared/ui/card";
|
||||||
import {
|
import {
|
||||||
@@ -106,7 +107,7 @@ const EditAgency = () => {
|
|||||||
form.setValue("name", agency.name);
|
form.setValue("name", agency.name);
|
||||||
form.setValue("addres", agency.addres);
|
form.setValue("addres", agency.addres);
|
||||||
form.setValue("email", agency.email);
|
form.setValue("email", agency.email);
|
||||||
form.setValue("phone", agency.phone);
|
form.setValue("phone", onlyNumber(agency.phone));
|
||||||
form.setValue("web_site", agency.web_site);
|
form.setValue("web_site", agency.web_site);
|
||||||
}
|
}
|
||||||
}, [data, form]);
|
}, [data, form]);
|
||||||
|
|||||||
@@ -129,10 +129,12 @@ const StepOne = ({
|
|||||||
|
|
||||||
// 🔹 TransportS
|
// 🔹 TransportS
|
||||||
const transports =
|
const transports =
|
||||||
tour.transports?.map((t, i) => ({
|
tour.transports?.map((t) => ({
|
||||||
transport: i + 1,
|
transport: t.transport.id,
|
||||||
price: t.price ?? 0,
|
price: t.price ?? 0,
|
||||||
})) ?? [];
|
})) ?? [];
|
||||||
|
console.log("transport", transports);
|
||||||
|
|
||||||
setTransportPrices(transports.map((t) => formatPrice(t.price ?? 0)));
|
setTransportPrices(transports.map((t) => formatPrice(t.price ?? 0)));
|
||||||
|
|
||||||
// 🔹 Tarif
|
// 🔹 Tarif
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
} from "@/shared/ui/form";
|
} from "@/shared/ui/form";
|
||||||
import { Input } from "@/shared/ui/input";
|
import { Input } from "@/shared/ui/input";
|
||||||
import IconSelect from "@/shared/ui/iocnSelect";
|
import IconSelect from "@/shared/ui/iocnSelect";
|
||||||
|
import { Label } from "@/shared/ui/label";
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
@@ -312,15 +313,17 @@ const TransportTable = ({
|
|||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="icon_name"
|
name="icon_name"
|
||||||
render={() => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{t("Belgi (Icon)")}</FormLabel>
|
<Label className="text-md">{t("Belgi (Icon)")}</Label>
|
||||||
<FormControl className="w-full">
|
|
||||||
|
<div className="flex flex-col gap-4 w-full">
|
||||||
<IconSelect
|
<IconSelect
|
||||||
setSelectedIcon={setSelectedIcon}
|
selectedIcon={field.value ?? ""}
|
||||||
selectedIcon={selectedIcon}
|
setSelectedIcon={(val: string) => field.onChange(val)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</div>
|
||||||
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ httpClient.interceptors.request.use(
|
|||||||
if (method === "get") {
|
if (method === "get") {
|
||||||
// GET so'rovlarda hozirgi i18n tilini yuboramiz
|
// GET so'rovlarda hozirgi i18n tilini yuboramiz
|
||||||
config.headers["Accept-Language"] = i18n.language;
|
config.headers["Accept-Language"] = i18n.language;
|
||||||
} else if (["put", "post", "delete"].includes(method)) {
|
} else if (["put", "patch", "post", "delete"].includes(method)) {
|
||||||
// PUT, POST, DELETE da faqat "uz"
|
// PUT, PATCH, POST, DELETE da faqat "uz"
|
||||||
config.headers["Accept-Language"] = "uz";
|
config.headers["Accept-Language"] = "uz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
export const hotelIcons = [
|
export const hotelIcons = [
|
||||||
{ name: "Wifi", uz: "Wi-Fi", ru: "Wi-Fi" },
|
{ name: "Wifi", uz: "Wi-Fi", ru: "Wi-Fi" },
|
||||||
{ name: "Bus", uz: "Avtobus", ru: "Автобус" },
|
{ name: "Bus", uz: "Avtobus", ru: "Автобус" },
|
||||||
{ name: "CarFront", uz: "Auto", ru: "Авто" },
|
|
||||||
{ name: "PlaneTakeoff", uz: "Avia", ru: "Авиа" },
|
{ name: "PlaneTakeoff", uz: "Avia", ru: "Авиа" },
|
||||||
{ name: "WifiOff", uz: "Wi-Fi mavjud emas", ru: "Нет Wi-Fi" },
|
{ name: "WifiOff", uz: "Wi-Fi mavjud emas", ru: "Нет Wi-Fi" },
|
||||||
{ name: "Tv", uz: "Televizor", ru: "Телевизор" },
|
{ name: "Tv", uz: "Televizor", ru: "Телевизор" },
|
||||||
|
|||||||
Reference in New Issue
Block a user