Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bruk av SWR revalidateOnFocus for å oppdatere Behovsvurdering og Eval… #166

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading