diff --git a/app/components/behandlinger-table/BehandlingerTable.tsx b/app/components/behandlinger-table/BehandlingerTable.tsx
index e779fdc..1ee38bb 100644
--- a/app/components/behandlinger-table/BehandlingerTable.tsx
+++ b/app/components/behandlinger-table/BehandlingerTable.tsx
@@ -6,7 +6,8 @@ import { formatIsoTimestamp } from '~/common/date'
import { decodeBehandling } from '~/common/decodeBehandling'
interface Props {
- visStatusSoek: boolean,
+ visStatusSoek?: boolean | true,
+ visBehandlingTypeSoek?: boolean | true,
behandlingerResponse: BehandlingerPage,
}
@@ -136,7 +137,7 @@ export default function BehandlingerTable(props: Props) {
- {behandlingtypeOptions()}
+ {props.visBehandlingTypeSoek ? behandlingtypeOptions() : <>>}
diff --git a/app/routes/batch.regulering.tsx b/app/routes/batch.regulering.tsx
index 3cf4da4..deb06f5 100644
--- a/app/routes/batch.regulering.tsx
+++ b/app/routes/batch.regulering.tsx
@@ -18,25 +18,23 @@ export const action = async ({ request }: ActionFunctionArgs) => {
const updates = Object.fromEntries(formData)
const accessToken = await requireAccessToken(request)
- let response
-
if (updates.formType === 'startRegulering') {
- response = await startRegulering(
+ await startRegulering(
accessToken,
updates.satsDato as string,
updates.reguleringsDato as string,
updates.sisteAktivitet as string,
updates.maxFamiliebehandlinger as string,
)
- return redirect(`/behandling/${response.behandlingId}`)
+ return redirect(`/batch/regulering`)
} else if (updates.formType === 'fortsettFamilie') {
- response = await fortsettBehandling(
+ await fortsettBehandling(
accessToken,
updates.behandlingIdFamilie as string,
updates.fortsettTilAktivitet as string,
)
- return redirect(`/behandling/${response.behandlingId}`)
+ return redirect(`/batch/regulering`)
} else if (updates.formType === 'fortsettAvhengige') {
await fortsettAvhengigeBehandling(
@@ -61,11 +59,11 @@ export const loader = async ({ request }: ActionFunctionArgs) => {
const behandlinger = await getBehandlinger(
accessToken,
"ReguleringUttrekk",
- null,
+ searchParams.get('status'),
null,
true,
page ? +page : 0,
- size ? +size : 100,
+ size ? +size : 3,
null
)
if (!behandlinger) {
@@ -86,7 +84,7 @@ export default function OpprettReguleringBatchRoute() {
-
+
)
diff --git a/app/routes/behandlinger.$status.tsx b/app/routes/behandlinger.$status.tsx
index 5285933..54da7f6 100644
--- a/app/routes/behandlinger.$status.tsx
+++ b/app/routes/behandlinger.$status.tsx
@@ -6,6 +6,7 @@ import { getBehandlinger } from '~/services/behandling.server'
import { requireAccessToken } from '~/services/auth.server'
import BehandlingerTable from '~/components/behandlinger-table/BehandlingerTable'
import invariant from 'tiny-invariant'
+import { BehandlingerPage } from '~/types'
export const loader = async ({ params, request }: ActionFunctionArgs) => {
invariant(params.status, 'Missing status param')
@@ -36,7 +37,7 @@ export default function BehandlingerStatus() {
return (
-
+
)
}
diff --git a/app/services/behandling.server.ts b/app/services/behandling.server.ts
index cbac6cd..60b278c 100644
--- a/app/services/behandling.server.ts
+++ b/app/services/behandling.server.ts
@@ -30,7 +30,7 @@ export async function getBehandlinger(
isBatch: boolean | null,
page: number,
size: number,
- sort: string | null,
+ sort?: string | null,
): Promise {
let request = ''
if (behandlingType) {