Skip to content

Commit

Permalink
Håndere geografiKode null
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiklem committed Jan 8, 2025
1 parent 3e57e73 commit 6a746a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
deploy-til-dev:
name: Deploy til dev-gcp
needs: bygg-og-push-docker-image
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/Infinity'
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/geografiKode'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion src/api/kandidat-søk-api/kandidatStillingssøk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const yrkeJobbonskeSchema = z.object({

const geografiJobbonskeSchema = z.object({
geografiKodeTekst: z.string(),
geografiKode: z.string(),
geografiKode: z.string().nullable(),
});

export const kandidatStillingssøkDTOSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/api/kandidat-søk-api/kandidatsøk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const totalSchema = z.object({

export const geografiJobbonskerSchema = z.object({
geografiKodeTekst: z.string(),
geografiKode: z.string(),
geografiKode: z.string().nullable(),
});

export const yrkeJobbonskerObjSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { sendEvent } from 'felles/amplitude';
import { Jobbønske } from 'felles/domene/kandidat/Jobbprofil';
import { getNummerFraSted, stedmappingFraGammeltNummer } from 'felles/MappingSted';
import { useEffect, useState } from 'react';
import {
GeografiØnske,
KandidatStillingssøkDTO,
useKandidatStillingssøk,
GeografiØnske,
} from '../../../api/kandidat-søk-api/kandidatStillingssøk';
import { Status } from '../filter/om-annonsen/Annonsestatus';
import { Publisert } from '../filter/om-annonsen/HvorErAnnonsenPublisert';
import useNavigering from '../useNavigering';
import { QueryParam } from '../utils/urlUtils';
import { getNummerFraSted, stedmappingFraGammeltNummer } from 'felles/MappingSted';

interface IuseKandidatStillingssøk {
kandidatnr: string;
Expand Down Expand Up @@ -44,9 +44,12 @@ export const useKandidatStillingssøkData = ({
const geografikoder =
geografiJobbonsker.length === 0
? [kommunenummerstring]
: geografiJobbonsker.map((g: GeografiØnske) =>
getNummerFraSted(g.geografiKode)
);
: geografiJobbonsker.map((g: GeografiØnske) => {
if (g.geografiKode) {
return getNummerFraSted(g.geografiKode);
}
return getNummerFraSted(g.geografiKodeTekst);
});

const konverterteGeografikoder = konverterStederTilNåværendeKoder(geografikoder);

Expand Down

0 comments on commit 6a746a2

Please sign in to comment.