Skip to content

Commit

Permalink
oppdatere enhet logikk
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesperpaulsen committed Feb 22, 2024
1 parent 5990b3d commit a70731f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class EnhetValueManager extends ContextValueManager {
passendeEnhet.enhetId,
);
}
return this.changeEnhetLocally(enheter, activeEnhet.data.aktivEnhet);
return this.#changeEnhetLocally(enheter, activeEnhet.data.aktivEnhet);
};

readonly #updateEnhetExternallyToMatchRequestedEnhet = async (
Expand Down Expand Up @@ -114,14 +114,14 @@ export class EnhetValueManager extends ContextValueManager {
return;
}

this.changeEnhetLocally(
this.#changeEnhetLocally(
this.state.veileder.enheter,
this.state.enhet.wsRequestedValue,
);
this.closeModal('enhet');
};

readonly changeEnhetLocally = async (
readonly #changeEnhetLocally = (
veiledersEnheter: Enhet[],
newEnhetId?: string | null,
) => {
Expand Down Expand Up @@ -155,8 +155,8 @@ export class EnhetValueManager extends ContextValueManager {
enheter: Enhet[],
newEnhetId?: string,
) => {
await this.changeEnhetLocally(enheter, newEnhetId);
this.contextHolderApi.changeEnhet(newEnhetId);
this.#changeEnhetLocally(enheter, newEnhetId);
return this.contextHolderApi.changeEnhet(newEnhetId);
};

readonly changeEnhetExternallyToLocalValue = async () => {
Expand All @@ -166,7 +166,7 @@ export class EnhetValueManager extends ContextValueManager {
};

readonly clearEnhet = () => {
this.changeEnhetLocally([]);
this.#changeEnhetLocally([]);
};

#haveLegalEnhet = (requestedEnhet: string, enheter: Enhet[]) =>
Expand Down

0 comments on commit a70731f

Please sign in to comment.