Skip to content
Snippets Groups Projects
Commit 3237c0c0 authored by Ahmad Nadil's avatar Ahmad Nadil
Browse files

feat: null validation

parent d57f6950
No related merge requests found
/* eslint-disable react-hooks/exhaustive-deps */
import { DeleteIcon, ViewIcon } from "@chakra-ui/icons"
import {
useColorModeValue,
......@@ -78,22 +79,22 @@ export const AssignmentCards = ({
assignment_id
)
const { students, fetchStudent } = useFetchStudent(scholarship_id)
const [applicants, setApplicants] = useState(students.length)
const [submissions, setSubmissions] = useState(submissionFile.length)
const [applicants, setApplicants] = useState(students?.length || 0)
const [submissions, setSubmissions] = useState(submissionFile?.length || 0)
useEffect(() => {
const fetchData = async () => {
await fetchFile()
setSubmissions(submissionFile.length)
}
fetchData()
}, [submissionFile.length])
}, [submissionFile?.length])
useEffect(() => {
const fetchData = async () => {
await fetchStudent()
setApplicants(students.length)
setApplicants(students?.length)
}
fetchData()
}, [students.length])
}, [students?.length])
// TODO: SET THE APPLICANTS AND SUBMSISSIONS @MATTHEW MAHENDRA
const [isOpenEditAssignment, setIsOpenEditAssignment] = useState(false)
const [isOpenDeleteAssignment, setIsOpenDeleteAssignment] =
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment