task update
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
|||||||
Banknote,
|
Banknote,
|
||||||
Calendar,
|
Calendar,
|
||||||
FileText,
|
FileText,
|
||||||
List,
|
|
||||||
Loader2,
|
Loader2,
|
||||||
MapPinCheck,
|
MapPinCheck,
|
||||||
MapPinHouse,
|
MapPinHouse,
|
||||||
@@ -46,14 +45,14 @@ const navItems: NavItem[] = [
|
|||||||
description: "Hujjatlar",
|
description: "Hujjatlar",
|
||||||
featured: true,
|
featured: true,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: "tour_plan",
|
// id: "tour_plan",
|
||||||
title: "Tur plan",
|
// title: "Tur plan",
|
||||||
link: "/tour-plan",
|
// link: "/tour-plan",
|
||||||
icon: <List className="w-6 h-6" />,
|
// icon: <List className="w-6 h-6" />,
|
||||||
description: "Rejalar",
|
// description: "Rejalar",
|
||||||
featured: true,
|
// featured: true,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
export interface CreatePharmacyReq {
|
export interface CreatePharmacyReq {
|
||||||
name: string;
|
name: string;
|
||||||
inn: string;
|
inn?: string;
|
||||||
owner_phone: string;
|
owner_phone: string;
|
||||||
responsible_phone: string;
|
responsible_phone?: string;
|
||||||
district_id: number;
|
district_id: number;
|
||||||
place_id: number;
|
place_id: number;
|
||||||
longitude: number;
|
longitude: number;
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ export const objectForm = z.object({
|
|||||||
}),
|
}),
|
||||||
latitude: z.number({ error: "Majburiy maydon" }),
|
latitude: z.number({ error: "Majburiy maydon" }),
|
||||||
longitude: z.number({ error: "Majburiy maydon" }),
|
longitude: z.number({ error: "Majburiy maydon" }),
|
||||||
inn: z.string().min(1, { message: "Majburiy maydon" }),
|
inn: z.string().optional(),
|
||||||
phoneDirector: z.string().min(17, { message: "Majburiy maydon" }),
|
phoneDirector: z.string().min(17, { message: "Majburiy maydon" }),
|
||||||
phonePharmacy: z.string().min(17, { message: "Majburiy maydon" }),
|
phonePharmacy: z.string().optional(),
|
||||||
nearbyCoords: z
|
nearbyCoords: z
|
||||||
.array(
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
|
|||||||
@@ -218,13 +218,15 @@ const CreatePharmacy = () => {
|
|||||||
latitude: values.latitude,
|
latitude: values.latitude,
|
||||||
longitude: values.longitude,
|
longitude: values.longitude,
|
||||||
},
|
},
|
||||||
inn: values.inn,
|
...(values.inn && { inn: values.inn }),
|
||||||
latitude: values.latitude,
|
latitude: values.latitude,
|
||||||
longitude: values.longitude,
|
longitude: values.longitude,
|
||||||
name: values.name,
|
name: values.name,
|
||||||
owner_phone: onlyNumber(values.phoneDirector),
|
owner_phone: onlyNumber(values.phoneDirector),
|
||||||
place_id: Number(values.streets),
|
place_id: Number(values.streets),
|
||||||
responsible_phone: onlyNumber(values.phonePharmacy),
|
...(values.phonePharmacy && {
|
||||||
|
responsible_phone: onlyNumber(values.phonePharmacy),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export interface CreatePlansReq {
|
export interface CreatePlansReq {
|
||||||
title: string;
|
// title: string;
|
||||||
description: string;
|
description: string;
|
||||||
date: string; // "2025-12-05";
|
date: string; // "2025-12-05";
|
||||||
doctor_id: number | null;
|
doctor_id: number | null;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export function PlanDetailsDialog({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<div className="space-y-1">
|
{/* <div className="space-y-1">
|
||||||
<p className="text-sm text-muted-foreground">Sarlavha</p>
|
<p className="text-sm text-muted-foreground">Sarlavha</p>
|
||||||
<p
|
<p
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@@ -121,14 +121,14 @@ export function PlanDetailsDialog({
|
|||||||
>
|
>
|
||||||
{task.title}
|
{task.title}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<p className="text-sm text-muted-foreground">Tavsifi</p>
|
<p className="text-sm text-muted-foreground">Tavsifi</p>
|
||||||
<p
|
<p
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"text-base leading-relaxed",
|
"text-lg font-semibold",
|
||||||
task.comment ? "text-green-500" : "text-foreground",
|
task.comment ? "text-green-500" : "text-foreground",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import z from "zod";
|
|||||||
import { plans_api } from "../lib/api";
|
import { plans_api } from "../lib/api";
|
||||||
|
|
||||||
const plansForm = z.object({
|
const plansForm = z.object({
|
||||||
title: z.string().min(1, "Sarlavha kiritish majburiy"),
|
// title: z.string().min(1, "Sarlavha kiritish majburiy"),
|
||||||
description: z.string().min(1, "Tavsif kiritish majburiy"),
|
description: z.string().min(1, "Tavsif kiritish majburiy"),
|
||||||
date: z.string().optional(),
|
date: z.string().optional(),
|
||||||
});
|
});
|
||||||
@@ -71,7 +71,7 @@ export const AddPlans = ({
|
|||||||
const form = useForm<z.infer<typeof plansForm>>({
|
const form = useForm<z.infer<typeof plansForm>>({
|
||||||
resolver: zodResolver(plansForm),
|
resolver: zodResolver(plansForm),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
title: "",
|
// title: "",
|
||||||
description: "",
|
description: "",
|
||||||
date: formatDate.format(new Date(), "YYYY-MM-DD"),
|
date: formatDate.format(new Date(), "YYYY-MM-DD"),
|
||||||
},
|
},
|
||||||
@@ -166,7 +166,7 @@ export const AddPlans = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (taskEdit) {
|
if (taskEdit) {
|
||||||
form.setValue("title", taskEdit.title);
|
// form.setValue("title", taskEdit.title);
|
||||||
form.setValue("description", taskEdit.description);
|
form.setValue("description", taskEdit.description);
|
||||||
form.setValue("date", taskEdit.date);
|
form.setValue("date", taskEdit.date);
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ export const AddPlans = ({
|
|||||||
: pharmId
|
: pharmId
|
||||||
? pharmId.longitude
|
? pharmId.longitude
|
||||||
: 63.123,
|
: 63.123,
|
||||||
title: values.title,
|
// title: values.title,
|
||||||
},
|
},
|
||||||
id: taskEdit.id,
|
id: taskEdit.id,
|
||||||
});
|
});
|
||||||
@@ -253,7 +253,7 @@ export const AddPlans = ({
|
|||||||
: pharmId
|
: pharmId
|
||||||
? pharmId.longitude
|
? pharmId.longitude
|
||||||
: 63.123,
|
: 63.123,
|
||||||
title: values.title,
|
// title: values.title,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,19 +368,7 @@ export const AddPlans = ({
|
|||||||
|
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
||||||
<FormField
|
{/* Z */}
|
||||||
control={form.control}
|
|
||||||
name="title"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>Sarlavha</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input placeholder="Sarlavha" {...field} />
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="description"
|
name="description"
|
||||||
|
|||||||
@@ -203,24 +203,22 @@ export default function Plans() {
|
|||||||
>
|
>
|
||||||
<div className="flex gap-3">
|
<div className="flex gap-3">
|
||||||
<div className="flex-1 flex flex-col">
|
<div className="flex-1 flex flex-col">
|
||||||
<h3
|
{/* <h3
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"font-semibold wrap-break-word",
|
"font-semibold wrap-break-word",
|
||||||
item.comment ? "text-green-500" : "text-foreground",
|
item.comment ? "text-green-500" : "text-foreground",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{item.title}
|
{item.title}
|
||||||
</h3>
|
</h3> */}
|
||||||
<p
|
<h3
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"text-sm wrap-break-word",
|
"font-semibold wrap-break-word",
|
||||||
item.comment
|
item.comment ? "text-green-500" : "text-foreground",
|
||||||
? "text-green-500"
|
|
||||||
: "text-muted-foreground",
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{item.description}
|
{item.description}
|
||||||
</p>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default defineConfig({
|
|||||||
port: 5174,
|
port: 5174,
|
||||||
host: true, // barcha hostlarga ruxsat
|
host: true, // barcha hostlarga ruxsat
|
||||||
allowedHosts: [
|
allowedHosts: [
|
||||||
"hugo-quotes-loved-wiki.trycloudflare.com", // ngrok host qo'shildi
|
"spin-ronald-officers-reasonably.trycloudflare.com", // ngrok host qo'shildi
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user