Compare commits
2 Commits
88dc5470d9
...
2dd4bccfcb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dd4bccfcb | ||
|
|
80df127d6e |
@@ -51,7 +51,7 @@ export interface PlanListData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface PlanCreateReq {
|
export interface PlanCreateReq {
|
||||||
// title: string;
|
title?: string;
|
||||||
description: string;
|
description: string;
|
||||||
date: string;
|
date: string;
|
||||||
user_id: number;
|
user_id: number;
|
||||||
@@ -63,7 +63,7 @@ export interface PlanCreateReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface PlanUpdateReq {
|
export interface PlanUpdateReq {
|
||||||
// title: string;
|
title?: string;
|
||||||
description: string;
|
description: string;
|
||||||
date: string;
|
date: string;
|
||||||
longitude: number;
|
longitude: number;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import z from "zod";
|
import z from "zod";
|
||||||
|
|
||||||
export const createPlanFormData = z.object({
|
export const createPlanFormData = z.object({
|
||||||
// name: z.string().min(1, { message: "Majburiy maydon" }),
|
name: z.string().optional(),
|
||||||
description: z.string().min(1, { message: "Majburiy maydon" }),
|
description: z.string().min(1, { message: "Majburiy maydon" }),
|
||||||
user: z.string().min(1, { message: "Majburiy maydon" }),
|
user: z.string().min(1, { message: "Majburiy maydon" }),
|
||||||
date: z.string().min(1, { message: "Majburiy maydon" }),
|
date: z.string().min(1, { message: "Majburiy maydon" }),
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import {
|
|||||||
FormItem,
|
FormItem,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/shared/ui/form";
|
} from "@/shared/ui/form";
|
||||||
|
import { Input } from "@/shared/ui/input";
|
||||||
import { Label } from "@/shared/ui/label";
|
import { Label } from "@/shared/ui/label";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from "@/shared/ui/popover";
|
import { Popover, PopoverContent, PopoverTrigger } from "@/shared/ui/popover";
|
||||||
import { Textarea } from "@/shared/ui/textarea";
|
import { Textarea } from "@/shared/ui/textarea";
|
||||||
@@ -173,13 +174,15 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
|||||||
body: {
|
body: {
|
||||||
date: formatDate.format(data.date, "YYYY-MM-DD"),
|
date: formatDate.format(data.date, "YYYY-MM-DD"),
|
||||||
description: data.description,
|
description: data.description,
|
||||||
|
...(data.name && {
|
||||||
|
title: data.name,
|
||||||
|
}),
|
||||||
extra_location: {
|
extra_location: {
|
||||||
latitude: initialValues.latitude,
|
latitude: initialValues.latitude,
|
||||||
longitude: initialValues.longitude,
|
longitude: initialValues.longitude,
|
||||||
},
|
},
|
||||||
latitude: initialValues.latitude,
|
latitude: initialValues.latitude,
|
||||||
longitude: initialValues.longitude,
|
longitude: initialValues.longitude,
|
||||||
// title: data.name,
|
|
||||||
},
|
},
|
||||||
id: initialValues.id,
|
id: initialValues.id,
|
||||||
});
|
});
|
||||||
@@ -193,7 +196,9 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
|||||||
},
|
},
|
||||||
latitude: lat,
|
latitude: lat,
|
||||||
longitude: long,
|
longitude: long,
|
||||||
// title: data.name,
|
...(data.name && {
|
||||||
|
title: data.name,
|
||||||
|
}),
|
||||||
doctor_id: data.doctor_id ? Number(data.doctor_id) : null,
|
doctor_id: data.doctor_id ? Number(data.doctor_id) : null,
|
||||||
pharmacy_id: data.pharmacy_id ? Number(data.pharmacy_id) : null,
|
pharmacy_id: data.pharmacy_id ? Number(data.pharmacy_id) : null,
|
||||||
user_id: Number(data.user),
|
user_id: Number(data.user),
|
||||||
@@ -498,7 +503,7 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* <FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="name"
|
name="name"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
@@ -514,7 +519,7 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
|||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/> */}
|
/>
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ const UserTable = ({
|
|||||||
{user.last_name ? user.last_name : "No'malum"}
|
{user.last_name ? user.last_name : "No'malum"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{user.region ? user.region.name : "No'malum"}
|
{user?.region ? user?.region?.name : "No'malum"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-center">
|
<TableCell className="text-center">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user