+
-
-
)
}
diff --git a/app/routes/batch-opprett.bpen068.tsx b/app/routes/batch-opprett.bpen068.tsx
index cfc0a50..705a5c8 100644
--- a/app/routes/batch-opprett.bpen068.tsx
+++ b/app/routes/batch-opprett.bpen068.tsx
@@ -9,7 +9,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
const updates = Object.fromEntries(formData)
const accessToken = await requireAccessToken(request)
- let response = await opprettBpen068(accessToken, updates.satsDato as string, updates.reguleringsDato as string)
+ let response = await opprettBpen068(accessToken, updates.satsDato as string, updates.reguleringsDato as string, updates.sisteAktivitet as string)
return redirect(`/behandling/${response.behandlingId}`)
}
diff --git a/app/services/batch.bpen068.server.ts b/app/services/batch.bpen068.server.ts
index 41660b1..d76b0f5 100644
--- a/app/services/batch.bpen068.server.ts
+++ b/app/services/batch.bpen068.server.ts
@@ -5,7 +5,18 @@ export async function opprettBpen068(
accessToken: string,
satsDato: string,
reguleringsDato: string,
+ sisteAktivitet: string,
): Promise
{
+
+ const body: any = {
+ satsDato: satsDato,
+ reguleringsDato: reguleringsDato,
+ }
+
+ if(sisteAktivitet !== ''){
+ body.sisteAktivitet = sisteAktivitet;
+ }
+
const response = await fetch(
`${env.penUrl}/api/vedtak/regulering/start`,
{
@@ -15,10 +26,7 @@ export async function opprettBpen068(
'Content-Type': 'application/json',
'X-Request-ID': crypto.randomUUID(),
},
- body: JSON.stringify({
- satsDato: satsDato,
- reguleringsDato: reguleringsDato,
- }),
+ body: JSON.stringify(body),
},
)