- {JSON.stringify(isData, null, 1)}
- {JSON.stringify(isDataMember, null, 1)}
{/*
-
+
- {item.name}
+ {item.title}
@@ -206,51 +207,51 @@ export default function ListTugasDetailProject() {
setOpenModal(false)}
- description="Apakah Anda yakin ingin menghapus proyek ini?"
- onYes={(val) => {
- if (val) {
- onDelete()
- }
- setOpenModal(false)
+ description="Apakah Anda yakin ingin menghapus proyek ini?"
+ onYes={(val) => {
+ if (val) {
+ onDelete()
+ }
+ setOpenModal(false)
}} />
-
- setOpenDrawerStatus(false)}>
-
-
- {
- valStatusDetailProject.map((item, index) => {
- return (
- { onUpdateStatus(item.value) }}>
-
-
-
- {item.name}
-
-
-
- {statusData === item.value ? : ""}
-
-
-
-
- )
- })
- }
-
-
-
+ setOpenDrawerStatus(false)}>
+
+
+ {
+ valStatusDetailProject.map((item, index) => {
+ return (
+ { onUpdateStatus(item.value) }}>
+
+
+
+ {item.name}
+
+
+
+ {statusData === item.value ? : ""}
+
+
+
+
+ )
+ })
+ }
+
+
+
+
>
diff --git a/src/module/project/ui/navbar_detail_project.tsx b/src/module/project/ui/navbar_detail_project.tsx
index d8fe710..9a930af 100644
--- a/src/module/project/ui/navbar_detail_project.tsx
+++ b/src/module/project/ui/navbar_detail_project.tsx
@@ -21,7 +21,7 @@ export default function NavbarDetailProject() {
try {
const res = await funGetOneProjectById(param.id, 'data');
if (res.success) {
- setName(res.data.name);
+ setName(res.data.title);
} else {
toast.error(res.message);
}
diff --git a/src/module/project/ui/progress_detail_project.tsx b/src/module/project/ui/progress_detail_project.tsx
index 20892da..90aebfd 100644
--- a/src/module/project/ui/progress_detail_project.tsx
+++ b/src/module/project/ui/progress_detail_project.tsx
@@ -3,7 +3,7 @@ import { WARNA } from '@/module/_global';
import { useHookstate } from '@hookstate/core';
import { ActionIcon, Box, Grid, Progress, Text } from '@mantine/core';
import { useParams } from 'next/navigation';
-import React, { useEffect, useState } from 'react';
+import React, { useState } from 'react';
import { HiMiniPresentationChartBar } from 'react-icons/hi2';
import { globalRefreshProject } from '../lib/val_project';
import toast from 'react-hot-toast';
@@ -39,7 +39,7 @@ export default function ProgressDetailProject() {
}
}
- useEffect(() => {
+ useShallowEffect(() => {
onRefresh()
}, [refresh.get()])
diff --git a/src/module/task/lib/api_task.ts b/src/module/task/lib/api_task.ts
index 80815f3..253ff78 100644
--- a/src/module/task/lib/api_task.ts
+++ b/src/module/task/lib/api_task.ts
@@ -26,12 +26,13 @@ export const funGetTaskDivisionById = async (path: string, kategori: string) =>
}
-export const funDeleteDetailTask = async (path: string) => {
+export const funDeleteDetailTask = async (path: string, data: { idProject: string }) => {
const response = await fetch(`/api/task/detail/${path}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
+ body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};
diff --git a/src/module/task/ui/detail_list_tugas_task.tsx b/src/module/task/ui/detail_list_tugas_task.tsx
index cbcc855..c18e4be 100644
--- a/src/module/task/ui/detail_list_tugas_task.tsx
+++ b/src/module/task/ui/detail_list_tugas_task.tsx
@@ -49,7 +49,7 @@ export default function ListTugasDetailTask() {
async function onDelete() {
try {
- const res = await funDeleteDetailTask(idData);
+ const res = await funDeleteDetailTask(idData, { idProject: param.detail });
if (res.success) {
toast.success(res.message);
refresh.set(true)
diff --git a/src/module/task/ui/detail_progress_task.tsx b/src/module/task/ui/detail_progress_task.tsx
index 42656f8..f498d2b 100644
--- a/src/module/task/ui/detail_progress_task.tsx
+++ b/src/module/task/ui/detail_progress_task.tsx
@@ -6,7 +6,7 @@ import { useParams } from "next/navigation";
import toast from "react-hot-toast";
import { HiMiniPresentationChartBar } from "react-icons/hi2";
import { funGetTaskDivisionById } from "../lib/api_task";
-import { useEffect, useState } from "react";
+import { useState } from "react";
import { globalRefreshTask } from "../lib/val_task";
import { useHookstate } from "@hookstate/core";
@@ -44,8 +44,7 @@ export default function ProgressDetailTask() {
}
-
- useEffect(() => {
+ useShallowEffect(() => {
onRefresh()
}, [refresh.get()])
@@ -56,44 +55,44 @@ export default function ProgressDetailTask() {
return (
{loading ?
-
- :
-
-
-
-
-
-
-
-
-
- Kemajuan Proyek {valProgress}%
-
-
-
-
-
+
+ :
+
+
+
+
+
+
+
+
+
+ Kemajuan Proyek {valProgress}%
+
+
+
+
+
}
)