bug fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export interface CreatePlansReq {
|
||||
// title: string;
|
||||
title?: string;
|
||||
description: string;
|
||||
date: string; // "2025-12-05";
|
||||
doctor_id: number | null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import z from "zod";
|
||||
|
||||
export const plansForm = z.object({
|
||||
title: z.string().min(1, { error: "Majburiy maydon" }),
|
||||
title: z.string().optional(),
|
||||
description: z.string().min(1, { error: "Majburiy maydon" }),
|
||||
date: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ import z from "zod";
|
||||
import { plans_api } from "../lib/api";
|
||||
|
||||
const plansForm = z.object({
|
||||
// title: z.string().min(1, "Sarlavha kiritish majburiy"),
|
||||
title: z.string().optional(),
|
||||
description: z.string().min(1, "Tavsif kiritish majburiy"),
|
||||
date: z.string().optional(),
|
||||
});
|
||||
@@ -195,6 +195,9 @@ export const AddPlans = ({
|
||||
if (taskEdit) {
|
||||
edit({
|
||||
body: {
|
||||
...(values.title && {
|
||||
title: values.title,
|
||||
}),
|
||||
date: values.date ? formatDate.format(values.date, "YYYY-MM-DD") : "",
|
||||
description: values.description,
|
||||
doctor_id: doctorId ? doctorId.id : null,
|
||||
@@ -221,12 +224,14 @@ export const AddPlans = ({
|
||||
: pharmId
|
||||
? pharmId.longitude
|
||||
: 63.123,
|
||||
// title: values.title,
|
||||
},
|
||||
id: taskEdit.id,
|
||||
});
|
||||
} else {
|
||||
added({
|
||||
...(values.title && {
|
||||
title: values.title,
|
||||
}),
|
||||
date: values.date ? formatDate.format(values.date, "YYYY-MM-DD") : "",
|
||||
description: values.description,
|
||||
doctor_id: doctorId ? doctorId.id : null,
|
||||
@@ -253,7 +258,6 @@ export const AddPlans = ({
|
||||
: pharmId
|
||||
? pharmId.longitude
|
||||
: 63.123,
|
||||
// title: values.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -368,7 +372,20 @@ export const AddPlans = ({
|
||||
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
||||
{/* Z */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Sarlavha</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Sarlavha" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="description"
|
||||
|
||||
Reference in New Issue
Block a user