fix : tampilan

deskripsi:
- detail divisi > on klik pda file
- update project dan tugas divisi tidak perlu loading judul project
- tampilan notifikasi top right info

No Issues
This commit is contained in:
2025-07-22 15:27:13 +08:00
parent 88dd6165f2
commit b4eab22731
6 changed files with 84 additions and 29 deletions

View File

@@ -38,14 +38,16 @@ export default function DetailProject() {
const [isMember, setIsMember] = useState(false)
const entityUser = useSelector((state: any) => state.user)
async function handleLoad() {
async function handleLoad(cat: 'data' | 'progress') {
try {
setLoading(true)
if (cat == 'data') setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiGetProjectOne({ user: hasil, cat: 'data', id: id })
setData(response.data)
const responseProgress = await apiGetProjectOne({ user: hasil, cat: 'progress', id: id })
setProgress(responseProgress.data.progress)
const response = await apiGetProjectOne({ user: hasil, cat: cat, id: id })
if (cat == 'data') {
setData(response.data)
} else {
setProgress(response.data.progress)
}
} catch (error) {
console.error(error)
} finally {
@@ -65,8 +67,12 @@ export default function DetailProject() {
}
useEffect(() => {
handleLoad()
}, [update.data, update.progress])
handleLoad('data')
}, [update.data])
useEffect(() => {
handleLoad('progress')
}, [update.progress])
useEffect(() => {
checkMember()