diff --git a/Dockerfile b/Dockerfile index e11355e3a..988ff1bc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,5 +28,7 @@ RUN mv $DIR/build/* $DIR/builds/acceptance/ FROM nginx:stable-alpine ADD nginx.conf /etc/nginx/nginx.conf +RUN apk update && apk upgrade libx11 + COPY --from=builder /var/www/builds /var/www CMD nginx -g 'daemon off;' diff --git a/src/app/components/case/forms/SummonForm/SummonForm.tsx b/src/app/components/case/forms/SummonForm/SummonForm.tsx index 8b27065d5..99401f67a 100644 --- a/src/app/components/case/forms/SummonForm/SummonForm.tsx +++ b/src/app/components/case/forms/SummonForm/SummonForm.tsx @@ -1,7 +1,7 @@ import { FormTitle } from "@amsterdam/asc-ui" -import { useCase, useSummons, useSummonTypes } from "app/state/rest/" +import { useSummons, useSummonTypesByTaskId } from "app/state/rest/" import WorkflowForm from "app/components/case/WorkflowForm/WorkflowForm" import scaffold from "app/components/case/forms/SummonForm/scaffold" import useScaffoldedFields from "app/components/shared/ConfirmScaffoldForm/hooks/useScaffoldedFields" @@ -52,12 +52,9 @@ const mapData = (data: SummonData) => { } const SummonForm: React.FC = ({ id, caseUserTaskId }) => { - - const themeId = useCase(id)[0]?.theme.id - const [data] = useSummonTypes(themeId) + const [data] = useSummonTypesByTaskId(caseUserTaskId) const summonTypes = data?.results - const summonTypesWithoutBoete = summonTypes?.filter((summonType) => summonType.workflow_option !== "besluit") - const fields = useScaffoldedFields(scaffold, id, summonTypesWithoutBoete) + const fields = useScaffoldedFields(scaffold, id, summonTypes) const [, { execPost }] = useSummons({ lazy: true }) return ( diff --git a/src/app/state/rest/tasks.ts b/src/app/state/rest/tasks.ts index 8a2048960..4837d5344 100644 --- a/src/app/state/rest/tasks.ts +++ b/src/app/state/rest/tasks.ts @@ -169,3 +169,15 @@ export const useTaskNames = (role: string) => { isProtected: true }) } + +// useSummonTypes for getting the available summonTypes for a specific task +export const useSummonTypesByTaskId = (id: Components.Schemas.CaseUserTaskWorkdflow["case_user_task_id"], options?: Options) => { + const handleError = useErrorHandler() + return useApiRequest({ + ...options, + url: makeApiUrl("tasks", id, "summon-types"), + groupName: "task", + handleError, + isProtected: true + }) +}