Compare commits
3 Commits
88dc5470d9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1498c4828 | ||
|
|
2dd4bccfcb | ||
|
|
80df127d6e |
@@ -1,5 +1,6 @@
|
||||
import type { DistrictListData } from "@/features/districts/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
Table,
|
||||
@@ -58,6 +59,7 @@ const TableDistrict = ({
|
||||
<TableHead>ID</TableHead>
|
||||
<TableHead>Tuman nomi</TableHead>
|
||||
<TableHead>Kim qo‘shgan</TableHead>
|
||||
<TableHead>Qo'shgan sanasi</TableHead>
|
||||
<TableHead className="text-right">Harakatlar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -70,6 +72,9 @@ const TableDistrict = ({
|
||||
<TableCell>
|
||||
{d.user.first_name} {d.user.last_name}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(d.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { DoctorListResData } from "@/features/doctors/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import formatPhone from "@/shared/lib/formatPhone";
|
||||
import { Badge } from "@/shared/ui/badge";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
@@ -68,6 +69,7 @@ const TableDoctor = ({
|
||||
<TableHead>Ish joyi</TableHead>
|
||||
<TableHead>Sohasi</TableHead>
|
||||
<TableHead>Kim qo'shgan</TableHead>
|
||||
<TableHead>Qo'shgan sanasi</TableHead>
|
||||
<TableHead className="text-right">Amallar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -91,6 +93,9 @@ const TableDoctor = ({
|
||||
<TableCell>
|
||||
{item.user.first_name} {item.user.last_name}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(item.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="text-right flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ObjectListData } from "@/features/objects/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Badge } from "@/shared/ui/badge";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
@@ -60,6 +61,7 @@ const ObjectTable = ({
|
||||
<TableHead>Obyekt nomi</TableHead>
|
||||
<TableHead>Tuman</TableHead>
|
||||
<TableHead>Foydalanuvchi</TableHead>
|
||||
<TableHead>Qo'shilgan sanasi</TableHead>
|
||||
<TableHead className="text-right">Amallar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -75,6 +77,9 @@ const ObjectTable = ({
|
||||
<TableCell>
|
||||
{item.user.first_name} {item.user.last_name}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(item.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="text-right flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
import AddedPharm from "@/features/pharm/ui/AddedPharm";
|
||||
import DeletePharm from "@/features/pharm/ui/DeletePharm";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -121,6 +122,7 @@ const PharmList = () => {
|
||||
<TableRow className="text-center">
|
||||
<TableHead className="text-start">ID</TableHead>
|
||||
<TableHead className="text-start">Nomi</TableHead>
|
||||
<TableHead className="text-start">Qo'shilgan sanasi</TableHead>
|
||||
<TableHead className="text-end">Amallar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -130,6 +132,9 @@ const PharmList = () => {
|
||||
<TableRow key={plan.id} className="text-start">
|
||||
<TableCell>{plan.id}</TableCell>
|
||||
<TableCell>{plan.name}</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(plan.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { PharmaciesListData } from "@/features/pharmacies/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import formatPhone from "@/shared/lib/formatPhone";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
@@ -44,6 +45,7 @@ const PharmaciesTable = ({
|
||||
<TableHead>Tuman</TableHead>
|
||||
<TableHead>Obyekt</TableHead>
|
||||
<TableHead>Kim qo'shgan</TableHead>
|
||||
<TableHead>Qo'shgan sanasi</TableHead>
|
||||
<TableHead className="text-right">Amallar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -61,6 +63,10 @@ const PharmaciesTable = ({
|
||||
{item.user.first_name} {item.user.last_name}
|
||||
</TableCell>
|
||||
|
||||
<TableCell>
|
||||
{formatDate.format(item.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
|
||||
<TableCell className="text-right flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -3,6 +3,7 @@ import { type PillListData, type PillType } from "@/features/pill/lib/data";
|
||||
import AddedPill from "@/features/pill/ui/AddedPill";
|
||||
import DeletePill from "@/features/pill/ui/DeletePill";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import formatPrice from "@/shared/lib/formatPrice";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
@@ -104,6 +105,7 @@ const PillList = () => {
|
||||
<TableHead className="text-start">ID</TableHead>
|
||||
<TableHead className="text-start">Nomi</TableHead>
|
||||
<TableHead className="text-start">Narxi</TableHead>
|
||||
<TableHead className="text-start">Qo'shilgan sanasi</TableHead>
|
||||
<TableHead className="text-end">Amallar</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -113,6 +115,9 @@ const PillList = () => {
|
||||
<TableCell>{plan.id}</TableCell>
|
||||
<TableCell>{plan.name}</TableCell>
|
||||
<TableCell>{formatPrice(plan.price)}</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(plan.created_at, "Dd-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -51,7 +51,7 @@ export interface PlanListData {
|
||||
}
|
||||
|
||||
export interface PlanCreateReq {
|
||||
// title: string;
|
||||
title?: string;
|
||||
description: string;
|
||||
date: string;
|
||||
user_id: number;
|
||||
@@ -63,7 +63,7 @@ export interface PlanCreateReq {
|
||||
}
|
||||
|
||||
export interface PlanUpdateReq {
|
||||
// title: string;
|
||||
title?: string;
|
||||
description: string;
|
||||
date: string;
|
||||
longitude: number;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import z from "zod";
|
||||
|
||||
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" }),
|
||||
user: z.string().min(1, { message: "Majburiy maydon" }),
|
||||
date: z.string().min(1, { message: "Majburiy maydon" }),
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
FormItem,
|
||||
FormMessage,
|
||||
} from "@/shared/ui/form";
|
||||
import { Input } from "@/shared/ui/input";
|
||||
import { Label } from "@/shared/ui/label";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/shared/ui/popover";
|
||||
import { Textarea } from "@/shared/ui/textarea";
|
||||
@@ -173,13 +174,15 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
||||
body: {
|
||||
date: formatDate.format(data.date, "YYYY-MM-DD"),
|
||||
description: data.description,
|
||||
...(data.name && {
|
||||
title: data.name,
|
||||
}),
|
||||
extra_location: {
|
||||
latitude: initialValues.latitude,
|
||||
longitude: initialValues.longitude,
|
||||
},
|
||||
latitude: initialValues.latitude,
|
||||
longitude: initialValues.longitude,
|
||||
// title: data.name,
|
||||
},
|
||||
id: initialValues.id,
|
||||
});
|
||||
@@ -193,7 +196,9 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
||||
},
|
||||
latitude: lat,
|
||||
longitude: long,
|
||||
// title: data.name,
|
||||
...(data.name && {
|
||||
title: data.name,
|
||||
}),
|
||||
doctor_id: data.doctor_id ? Number(data.doctor_id) : null,
|
||||
pharmacy_id: data.pharmacy_id ? Number(data.pharmacy_id) : null,
|
||||
user_id: Number(data.user),
|
||||
@@ -498,7 +503,7 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* <FormField
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
@@ -514,7 +519,7 @@ const AddedPlan = ({ initialValues, setDialogOpen }: Props) => {
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/> */}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { PlanListData } from "@/features/plans/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
Table,
|
||||
@@ -60,6 +61,8 @@ const PalanTable = ({
|
||||
<TableHead className="text-start">ID</TableHead>
|
||||
<TableHead className="text-start">Reja nomi</TableHead>
|
||||
<TableHead className="text-start">Tavsifi</TableHead>
|
||||
<TableHead className="text-start">Qo'shilgan sanasi</TableHead>
|
||||
<TableHead className="text-start">Bajarilish sanasi</TableHead>
|
||||
<TableHead className="text-start">Kimga tegishli</TableHead>
|
||||
<TableHead className="text-start">Shifokor biriktirgan</TableHead>
|
||||
<TableHead className="text-start">
|
||||
@@ -75,6 +78,12 @@ const PalanTable = ({
|
||||
<TableCell>{plan.id}</TableCell>
|
||||
<TableCell>{plan.title}</TableCell>
|
||||
<TableCell>{plan.description}</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(plan.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(plan.date, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{plan.user.first_name + " " + plan.user.last_name}
|
||||
</TableCell>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { RegionListResData } from "@/features/region/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
Table,
|
||||
@@ -51,6 +52,7 @@ const RegionTable = ({
|
||||
<TableRow className="text-center">
|
||||
<TableHead className="text-start">ID</TableHead>
|
||||
<TableHead className="text-start">Nomi</TableHead>
|
||||
<TableHead className="text-start">Qo'shilgan sanasi</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -58,6 +60,9 @@ const RegionTable = ({
|
||||
<TableRow key={plan.id} className="text-start">
|
||||
<TableCell>{index + 1}</TableCell>
|
||||
<TableCell>{plan.name}</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(plan.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="flex gap-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { user_api } from "@/features/users/lib/api";
|
||||
import type { UserListData, UserListRes } from "@/features/users/lib/data";
|
||||
import { userStore } from "@/shared/hooks/user";
|
||||
import formatDate from "@/shared/lib/formatDate";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { Checkbox } from "@/shared/ui/checkbox";
|
||||
import {
|
||||
@@ -131,6 +132,7 @@ const UserTable = ({
|
||||
<TableHead className="text-start">Ismi</TableHead>
|
||||
<TableHead className="text-start">Familiyasi</TableHead>
|
||||
<TableHead className="text-start">Hududi</TableHead>
|
||||
<TableHead className="text-start">Qo'shilgan sanasi</TableHead>
|
||||
<TableHead className="text-center">Holati</TableHead>
|
||||
<TableHead className="text-right">Harakatlar</TableHead>
|
||||
</TableRow>
|
||||
@@ -157,7 +159,10 @@ const UserTable = ({
|
||||
{user.last_name ? user.last_name : "No'malum"}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{user.region ? user.region.name : "No'malum"}
|
||||
{user?.region ? user?.region?.name : "No'malum"}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{formatDate.format(user?.created_at, "DD-MM-YYYY")}
|
||||
</TableCell>
|
||||
<TableCell className="text-center">
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user