From c0655145b10eb7e7818f6f3a7d79c341fbe17479 Mon Sep 17 00:00:00 2001 From: Joar Aurdal Date: Mon, 14 Oct 2024 21:36:45 +0200 Subject: [PATCH] Bruk useswr --- src/api/stillings-api/stillingsanalyse.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/api/stillings-api/stillingsanalyse.ts b/src/api/stillings-api/stillingsanalyse.ts index 6a3cdc9e..5e858d7c 100644 --- a/src/api/stillings-api/stillingsanalyse.ts +++ b/src/api/stillings-api/stillingsanalyse.ts @@ -1,6 +1,10 @@ -import useSWR from 'swr'; +/** + * Endepunkt /rekrutteringsbistand/stillingsanalyse + */ +import { HttpResponse, http } from 'msw'; import { z } from 'zod'; import { postApiWithSchema } from '../fetcher'; +import useSWR from 'swr'; const stillingsanalyseEndepunkt = '/stilling-api/rekrutteringsbistand/stillingsanalyse'; @@ -47,3 +51,9 @@ export const useStillingsanalyse = (props: StillingsanalyseRequestDTO, vis: bool error: error, }; }; + +export const stillingsanalyseMockMsw = http.post(stillingsanalyseEndepunkt, async (_) => { + return HttpResponse.json(mock); +}); + +const mock: StillingsanalyseDTO = { sensitiv: false, begrunnelse: '' };