Skip to content

Commit

Permalink
feat:task details and task edit page created
Browse files Browse the repository at this point in the history
  • Loading branch information
ademsuslu committed Nov 24, 2024
1 parent 8a59340 commit 3de4246
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/(dashboard)/bussines/task/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { buttonVariants } from "@/components/ui/button"
import Link from "next/link"


export default async function BussinesDetails({
export default async function TasksDetails({
params,
}: {
params: Promise<{ id: string }>
Expand All @@ -14,12 +14,12 @@ export default async function BussinesDetails({
console.log(data)
return (<div className="flex flex-col justify-between items-center gap-2">
<div className="flex w-full justify-between gap-2">
<Link href={"/bussines"} className={buttonVariants({})}>Back</Link>
<Link href={"/bussines/task"} className={buttonVariants({})}>Back</Link>
<ButtonsExport type="bussines" id={id} />
</div>
<div className="w-full">
{
data.map((item: any) => item.name)
data.map((item: any) => item.title)
}
{id}
</div>
Expand Down
30 changes: 30 additions & 0 deletions app/(dashboard)/bussines/task/edit/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import ButtonsExport from "@/components/shared/detay/buttons-export"
import { buttonVariants } from "@/components/ui/button"
import Link from "next/link"


export default async function TaskEdit({
params,
}: {
params: Promise<{ id: string }>
}) {
const id = (await params).id
const response = await fetch(`https://crm-backend-production-e80f.up.railway.app/api/tasks/${id}`, { cache: 'no-store' })
const data = await response.json()
console.log(data)
return (<div className="flex flex-col justify-between items-center gap-2">
<div className="flex w-full justify-between gap-2">
<Link href={"/bussines/task"} className={buttonVariants({})}>Back</Link>
<ButtonsExport type="bussines" id={id} />
</div>
<div className="w-full">
Task Details
{
data.map((item: any) => item.title)
}
{id}
</div>


</div>)
}
10 changes: 3 additions & 7 deletions components/shared/datatables/task/task-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,16 @@ export const columns: ColumnDef<Task>[] = [
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem >
<Link className="inline-flex items-center" href={`/customer/${row.original._id}`}>
<Link className="inline-flex items-center" href={`/bussines/${row.original._id}`}>
<FaEye className="w-4 h-4 mr-2" /> Show Details
</Link>
</DropdownMenuItem>
<DropdownMenuItem >
<Link className="inline-flex items-center" href={`/customer/edit/${row.original._id}`}>
<Link className="inline-flex items-center" href={`/bussines/edit/${row.original._id}`}>
<FaEdit className="w-4 h-4 mr-2" /> Edit
</Link>
</DropdownMenuItem>
<DropdownMenuItem >
<Link className="inline-flex items-center" href={`/customer/${row.original._id}/create`}>
<IoIosTimer className="w-5 h-5 mr-2" /> Add Reminder
</Link>
</DropdownMenuItem>

</DropdownMenuContent>
</DropdownMenu>
}
Expand Down
1 change: 0 additions & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function cn(...inputs: ClassValue[]) {
}



export function formatToTurkeyTime(dateString: string) {
const date = new Date(dateString); // Tarihi oluştur
return date.toLocaleString("tr-TR", {
Expand Down

0 comments on commit 3de4246

Please sign in to comment.