diff --git a/frontend/src/hooks/useAuditLog.ts b/frontend/src/hooks/useAuditLog.ts index 0b2f7ee7..2c1b161f 100644 --- a/frontend/src/hooks/useAuditLog.ts +++ b/frontend/src/hooks/useAuditLog.ts @@ -8,7 +8,6 @@ import { DestructionList } from "../lib/api/destructionLists"; * Hook resolving audit log items */ export function useAuditLog(destructionList?: DestructionList): AuditLogItem[] { - const [errorState, setErrorState] = useState(); const alert = useAlert(); const [auditLogState, setAuditLogState] = useState([]); @@ -21,13 +20,12 @@ export function useAuditLog(destructionList?: DestructionList): AuditLogItem[] { listAuditLog(destructionList.uuid) .then((a) => setAuditLogState(a)) .catch((e) => { - console.error(errorState); + console.error(e); alert( "Foutmelding", "Er is een fout opgetreden bij het ophalen van de audit log!", "Ok", ); - setErrorState(e); }); }, [destructionList?.uuid]); diff --git a/frontend/src/hooks/useLatestReviewResponse.ts b/frontend/src/hooks/useLatestReviewResponse.ts index 9e00a720..4f3c9824 100644 --- a/frontend/src/hooks/useLatestReviewResponse.ts +++ b/frontend/src/hooks/useLatestReviewResponse.ts @@ -13,7 +13,6 @@ import { export function useLatestReviewResponse( review?: Review, ): ReviewResponse | null { - const [errorState, setErrorState] = useState(); const alert = useAlert(); const [reviewResponseState, setReviewResponseState] = @@ -26,13 +25,12 @@ export function useLatestReviewResponse( getLatestReviewResponse({ review: review.pk }) .then((r) => setReviewResponseState(r || null)) .catch((e) => { - console.error(errorState); + console.error(e); alert( "Foutmelding", "Er is een fout opgetreden bij het ophalen van de verwerkte beoordeling!", "Ok", ); - setErrorState(e); }); }, [review?.pk]); diff --git a/frontend/src/hooks/useReviewers.ts b/frontend/src/hooks/useReviewers.ts index 745c7dbe..2cb33473 100644 --- a/frontend/src/hooks/useReviewers.ts +++ b/frontend/src/hooks/useReviewers.ts @@ -8,7 +8,6 @@ import { listReviewers } from "../lib/api/reviewers"; * Hook resolving reviewers */ export function useReviewers(): User[] { - const [errorState, setErrorState] = useState(); const alert = useAlert(); const [reviewersState, setReviewersState] = useState([]); @@ -16,13 +15,12 @@ export function useReviewers(): User[] { listReviewers() .then((r) => setReviewersState(r)) .catch((e) => { - console.error(errorState); + console.error(e); alert( "Foutmelding", "Er is een fout opgetreden bij het ophalen van beoordelaars!", "Ok", ); - setErrorState(e); }); }, []); diff --git a/frontend/src/pages/destructionlist/hooks/useSelectielijstKlasseChoices.ts b/frontend/src/pages/destructionlist/hooks/useSelectielijstKlasseChoices.ts index 20e7a3ed..c47a4cae 100644 --- a/frontend/src/pages/destructionlist/hooks/useSelectielijstKlasseChoices.ts +++ b/frontend/src/pages/destructionlist/hooks/useSelectielijstKlasseChoices.ts @@ -7,7 +7,6 @@ import { listSelectielijstKlasseChoices } from "../../../lib/api/private"; * Hook resolving selectielijst choices */ export function useSelectielijstKlasseChoices(): Option[] { - const [errorState, setErrorState] = useState(); const alert = useAlert(); const [selectielijstChoicesState, setSelectielijstChoicesState] = useState< @@ -17,13 +16,12 @@ export function useSelectielijstKlasseChoices(): Option[] { listSelectielijstKlasseChoices() .then((s) => setSelectielijstChoicesState(s)) .catch((e) => { - console.error(errorState); + console.error(e); alert( "Foutmelding", "Er is een fout opgetreden bij het ophalen van selectielijst klassen!", "Ok", ); - setErrorState(e); }); }, []); diff --git a/frontend/src/pages/destructionlist/hooks/useZaaktypeChoices.ts b/frontend/src/pages/destructionlist/hooks/useZaaktypeChoices.ts index 8fc51199..d812ee4c 100644 --- a/frontend/src/pages/destructionlist/hooks/useZaaktypeChoices.ts +++ b/frontend/src/pages/destructionlist/hooks/useZaaktypeChoices.ts @@ -14,7 +14,6 @@ export function useZaaktypeChoices( destructionList?: DestructionList, review?: Review, ): ZaaktypeChoice[] { - const [errorState, setErrorState] = useState(); const alert = useAlert(); const [zaaktypeChoicesState, setZaaktypeChoicesState] = useState< @@ -24,13 +23,12 @@ export function useZaaktypeChoices( listZaaktypeChoices(destructionList?.uuid, review?.pk) .then((z) => setZaaktypeChoicesState(z)) .catch((e) => { - console.error(errorState); + console.error(e); alert( "Foutmelding", "Er is een fout opgetreden bij het ophalen van zaaktypen!", "Ok", ); - setErrorState(e); }); }, [destructionList?.uuid, review?.pk]);