update new api reques and response
This commit is contained in:
@@ -21,13 +21,7 @@ import { DashboardLayout } from "@/widgets/dashboard-layout/ui";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import type { AxiosError } from "axios";
|
||||
import clsx from "clsx";
|
||||
import {
|
||||
CalendarIcon,
|
||||
Loader2,
|
||||
Pencil,
|
||||
Trash,
|
||||
TriangleAlert,
|
||||
} from "lucide-react";
|
||||
import { CalendarIcon, Loader2, Pencil, TriangleAlert } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
@@ -96,10 +90,10 @@ export default function Plans() {
|
||||
setIsPlanDetailsOpen(true);
|
||||
};
|
||||
|
||||
const handleDeleteTask = (task: Task) => {
|
||||
setSelectedTask(task);
|
||||
setDeleteDialogOpen(true);
|
||||
};
|
||||
// const handleDeleteTask = (task: Task) => {
|
||||
// setSelectedTask(task);
|
||||
// setDeleteDialogOpen(true);
|
||||
// };
|
||||
|
||||
const grouped = groupByDate(data?.data.data || []);
|
||||
|
||||
@@ -212,7 +206,7 @@ export default function Plans() {
|
||||
<h3
|
||||
className={clsx(
|
||||
"font-semibold wrap-break-word",
|
||||
item.is_done ? "text-green-500" : "text-foreground",
|
||||
item.comment ? "text-green-500" : "text-foreground",
|
||||
)}
|
||||
>
|
||||
{item.title}
|
||||
@@ -220,7 +214,7 @@ export default function Plans() {
|
||||
<p
|
||||
className={clsx(
|
||||
"text-sm wrap-break-word",
|
||||
item.is_done
|
||||
item.comment
|
||||
? "text-green-500"
|
||||
: "text-muted-foreground",
|
||||
)}
|
||||
@@ -230,7 +224,7 @@ export default function Plans() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<div className="grid grid-cols-1 gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
@@ -240,12 +234,12 @@ export default function Plans() {
|
||||
setIsAddDialogOpen(true);
|
||||
}}
|
||||
className="p-4"
|
||||
disabled={item.is_done}
|
||||
disabled={item.comment ? true : false}
|
||||
>
|
||||
<Pencil className="h-4 w-4" />
|
||||
<p>Tahrirlash</p>
|
||||
</Button>
|
||||
<Button
|
||||
{/* <Button
|
||||
size="sm"
|
||||
variant="destructive"
|
||||
onClick={(e) => {
|
||||
@@ -257,7 +251,7 @@ export default function Plans() {
|
||||
>
|
||||
<Trash className="h-4 w-4" />
|
||||
<p>{"O'chirish"}</p>
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user