diff --git a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg2/Steg2.tsx b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg2/Steg2.tsx index ce3dc3c1753..80b2d3e006f 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg2/Steg2.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg2/Steg2.tsx @@ -1,4 +1,4 @@ -import React, { useContext } from 'react' +import React, { useContext, useEffect } from 'react' import { harAvhukedeAttributter } from '@/components/bestillingsveileder/utils' import { BestillingsveilederContext } from '@/components/bestillingsveileder/BestillingsveilederContext' import { SigrunstubForm } from '@/components/fagsystem/sigrunstub/form/Form' @@ -46,6 +46,12 @@ export const Steg2 = () => { const opts: any = useContext(BestillingsveilederContext) const formMethods = useFormContext() + useEffect(() => { + if (opts.gruppe?.id) { + formMethods.setValue('gruppeId', opts.gruppe?.id) + } + }, []) + const leggTil = opts.is.leggTil const importTestnorge = opts.is.importTestnorge const gruppe = opts.gruppe