upd: task divisi

Deskripsi:
- update task divisi
- delete detail task
- update status task
- edit detail task

No Issues
This commit is contained in:
amel
2024-08-19 13:22:02 +08:00
parent 390e13544a
commit e8fcf44558
11 changed files with 592 additions and 20 deletions

View File

@@ -6,12 +6,16 @@ import { useParams } from "next/navigation";
import toast from "react-hot-toast";
import { HiMiniPresentationChartBar } from "react-icons/hi2";
import { funGetTaskDivisionById } from "../lib/api_task";
import { useState } from "react";
import { useEffect, useState } from "react";
import { globalRefreshTask } from "../lib/val_task";
import { useHookstate } from "@hookstate/core";
export default function ProgressDetailTask() {
const [valProgress, setValProgress] = useState(0)
const [valLastUpdate, setValLastUpdate] = useState('')
const param = useParams<{ id: string, detail: string }>()
const refresh = useHookstate(globalRefreshTask)
async function getOneData() {
try {
const res = await funGetTaskDivisionById(param.detail, 'progress');
@@ -28,6 +32,19 @@ export default function ProgressDetailTask() {
}
}
function onRefresh() {
if (refresh.get()) {
getOneData()
refresh.set(false)
}
}
useEffect(() => {
onRefresh()
}, [refresh.get()])
useShallowEffect(() => {
getOneData();
}, [param.detail])
@@ -66,7 +83,7 @@ export default function ProgressDetailTask() {
size="xl"
value={valProgress}
/>
<Text>{valLastUpdate}</Text>
{/* <Text c={"dimmed"}>Update terakhir : {valLastUpdate}</Text> */}
</Box>
</Grid.Col>
</Grid>