Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mark stoker committed Apr 2, 2024
1 parent 5699a10 commit 737efb8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/features/Kanalen/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ import { fetchLoggedIn, ServiceResult, throwIfNotOk } from "@/services";

async function fetchAll(url: string) {
return await fetchLoggedIn(url)
.then(throwIfNotOk)
.then((r) => r.json());
.then(throwIfNotOk)
.then((r) => r.json());
}

export function useKanalen() {
const kanalen = ServiceResult.fromFetcher("/api/KanalenBeheerOverzicht", fetchAll, { poll: false } );
const kanalen = ServiceResult.fromFetcher(
"/api/KanalenBeheerOverzicht",
fetchAll,
);

return kanalen
return kanalen;
}

export function useKanalenKeuzeLijst() {
return ServiceResult.fromFetcher("/api/KanalenContactmomentKeuzelijst", fetchAll);
}
return ServiceResult.fromFetcher(
"/api/KanalenContactmomentKeuzelijst",
fetchAll,
);
}

0 comments on commit 737efb8

Please sign in to comment.