Skip to content

Commit

Permalink
api has changed, now need orgnr as header
Browse files Browse the repository at this point in the history
  • Loading branch information
kenglxn committed Oct 2, 2023
1 parent 607db77 commit c355698
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App/OrganisasjonDetaljerProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const OrganisasjonsDetaljerProvider: FunctionComponent<Props> = ({ childr

if (orgInfo.altinntilgang.rekruttering) {
settBedriftIPam(orgInfo.organisasjon.OrganizationNumber).then(() =>
hentAntallannonser().then(setantallAnnonser)
hentAntallannonser(orgInfo.organisasjon.OrganizationNumber).then(setantallAnnonser)
);
} else {
setantallAnnonser(0);
Expand Down
5 changes: 4 additions & 1 deletion src/api/pamApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ interface PamStatusAnnonser {
PUBLISERT: number;
}

export const hentAntallannonser = async (): Promise<number> => {
export const hentAntallannonser = async (orgnr: string): Promise<number> => {
const respons = await fetch(
'/min-side-arbeidsgiver/stillingsregistrering-api/api/stillinger/numberByStatus',
{
method: 'GET',
headers: {
organizationNumber: orgnr,
},
}
);
if (respons.ok) {
Expand Down

0 comments on commit c355698

Please sign in to comment.