From acb9fdd25c9bfb524cb38a1ef598758db91bec73 Mon Sep 17 00:00:00 2001 From: Thomas Dufourd Date: Thu, 31 Oct 2024 16:33:02 +0100 Subject: [PATCH] =?UTF-8?q?Bruk=20av=20SWR=20revalidateOnFocus=20for=20?= =?UTF-8?q?=C3=A5=20oppdatere=20Behovsvurdering=20og=20Evaluering=20faner?= =?UTF-8?q?=20i=20Fia=20etter=20at=20disse=20kan=20har=20blitt=20fullf?= =?UTF-8?q?=C3=B8rt=20i=20Fia-arbeidsgiver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yaml | 2 +- .../Kartlegging/BehovsvurderingCardHeaderInnhold.tsx | 6 +++++- .../src/api/lydia-api/sp\303\270rreunders\303\270kelse.ts" | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eb3647205..4c35f19b6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -74,7 +74,7 @@ jobs: id-token: write name: Deploy app to dev needs: build - if: github.ref == 'refs/heads/breaking-changes-update' + if: github.ref == 'refs/heads/revalidate-on-focus-for-noen-lister' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/client/src/Pages/Virksomhet/Kartlegging/BehovsvurderingCardHeaderInnhold.tsx b/client/src/Pages/Virksomhet/Kartlegging/BehovsvurderingCardHeaderInnhold.tsx index b19bb0188..a13852e28 100644 --- a/client/src/Pages/Virksomhet/Kartlegging/BehovsvurderingCardHeaderInnhold.tsx +++ b/client/src/Pages/Virksomhet/Kartlegging/BehovsvurderingCardHeaderInnhold.tsx @@ -9,7 +9,10 @@ import EksportVisning from "./EksportVisning"; import { FlyttTilAnnenProsess } from "./FlyttTilAnnenProsess"; import { SpørreundersøkelseStatusBadge } from "../../../components/Badge/SpørreundersøkelseStatusBadge"; import { TrashIcon } from "@navikt/aksel-icons"; -import { CardHeaderProps, useSpørreundersøkelse } from "../../../components/Spørreundersøkelse/SpørreundersøkelseContext"; +import { + CardHeaderProps, + useSpørreundersøkelse, +} from "../../../components/Spørreundersøkelse/SpørreundersøkelseContext"; import { useHentIASaksStatus } from "../../../api/lydia-api/sak"; import { avsluttSpørreundersøkelse, @@ -104,6 +107,7 @@ export const BehovsvurderingCardHeaderInnhold = ({ const { iaSak, brukerRolle, samarbeid, brukerErEierAvSak } = useSpørreundersøkelse(); + const { mutate: hentBehovsvurderingPåNytt } = useHentSpørreundersøkelser( iaSak.orgnr, iaSak.saksnummer, diff --git "a/client/src/api/lydia-api/sp\303\270rreunders\303\270kelse.ts" "b/client/src/api/lydia-api/sp\303\270rreunders\303\270kelse.ts" index a4691e8e6..ac4b9221f 100644 --- "a/client/src/api/lydia-api/sp\303\270rreunders\303\270kelse.ts" +++ "b/client/src/api/lydia-api/sp\303\270rreunders\303\270kelse.ts" @@ -80,6 +80,10 @@ export const useHentSpørreundersøkelser = ( return useSwrTemplate( `${spørreundersøkelsePath}/${orgnummer}/${saksnummer}/prosess/${prosessId}/type/${type}`, spørreundersøkelseSchema.array(), + { + revalidateOnFocus: true, + revalidateOnReconnect: true, + }, ); }; export const opprettSpørreundersøkelse = (