Skip to content

Commit

Permalink
Småfiksing på reguleringstabellen. La på manglende optional tegn for …
Browse files Browse the repository at this point in the history
…sort i getBehandlinger().

Mulighet for å skjule behandlingsType i tabellen.
  • Loading branch information
Anders Refsahl committed Nov 27, 2024
1 parent 621ac55 commit 766649d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
5 changes: 3 additions & 2 deletions app/components/behandlinger-table/BehandlingerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -136,7 +137,7 @@ export default function BehandlingerTable(props: Props) {
<Table.DataCell style={{ paddingTop: 0 }}>
</Table.DataCell>
<Table.DataCell style={{ paddingTop: 0 }}>
{behandlingtypeOptions()}
{props.visBehandlingTypeSoek ? behandlingtypeOptions() : <></>}
</Table.DataCell>
<Table.DataCell style={{ paddingTop: 0 }}>
</Table.DataCell>
Expand Down
16 changes: 7 additions & 9 deletions app/routes/batch.regulering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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) {
Expand All @@ -86,7 +84,7 @@ export default function OpprettReguleringBatchRoute() {
<FortsettAvhengigeReguleringBehandlinger />
</div>
<div id="behandlinger">
<BehandlingerTable visStatusSoek={true} behandlingerResponse={behandlinger as BehandlingerPage} />
<BehandlingerTable visStatusSoek={true} visBehandlingTypeSoek={false} behandlingerResponse={behandlinger as BehandlingerPage} />
</div>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion app/routes/behandlinger.$status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -36,7 +37,7 @@ export default function BehandlingerStatus() {

return (
<div id="behandlinger">
<BehandlingerTable visStatusSoek={false} behandlingerResponse={behandlinger} />
<BehandlingerTable visStatusSoek={false} behandlingerResponse={behandlinger as BehandlingerPage} />
</div>
)
}
2 changes: 1 addition & 1 deletion app/services/behandling.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function getBehandlinger(
isBatch: boolean | null,
page: number,
size: number,
sort: string | null,
sort?: string | null,
): Promise<BehandlingerPage> {
let request = ''
if (behandlingType) {
Expand Down

0 comments on commit 766649d

Please sign in to comment.