Skip to content

Commit

Permalink
Bruk av SWR revalidateOnFocus for å oppdatere Behovsvurdering og Eval…
Browse files Browse the repository at this point in the history
…uering faner i Fia etter at disse kan har blitt fullført i Fia-arbeidsgiver
  • Loading branch information
thomasdufourd committed Oct 31, 2024
1 parent fd43f2e commit acb9fdd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions client/src/api/lydia-api/spørreundersøkelse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export const useHentSpørreundersøkelser = (
return useSwrTemplate<Spørreundersøkelse[]>(
`${spørreundersøkelsePath}/${orgnummer}/${saksnummer}/prosess/${prosessId}/type/${type}`,
spørreundersøkelseSchema.array(),
{
revalidateOnFocus: true,
revalidateOnReconnect: true,
},
);
};
export const opprettSpørreundersøkelse = (
Expand Down

0 comments on commit acb9fdd

Please sign in to comment.