Skip to content

Commit

Permalink
feat: add selected org unit to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Nov 25, 2024
1 parent 1ce0a2c commit 08fa169
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const buildOrgUnitSettingsFn = () => {
label: i18n.t('Organisation unit'),
required: true,
}),
getPropName: () => 'orgUnitId',
getPropName: () => 'orgUnit',
getValidatorContainers: () => getOrgUnitValidatorContainers(),
getMeta: () => ({
placement: placements.TOP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const dataEntryPropsToInclude: DataEntryPropsToInclude = [
validatorContainers: getEventDateValidatorContainers(),
},
{
id: 'orgUnitId',
id: 'orgUnit',
type: 'ORGANISATION_UNIT',
validatorContainers: getOrgUnitValidatorContainers(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export const getAddEventEnrollmentServerData = ({
mainDataClientValues,
eventId,
programId,
orgUnitId,
orgUnitName,
teiId,
enrollmentId,
completed,
Expand All @@ -25,8 +23,6 @@ export const getAddEventEnrollmentServerData = ({
mainDataClientValues: Object,
eventId: string,
programId: string,
orgUnitId: string,
orgUnitName: string,
teiId: string,
enrollmentId: string,
completed?: boolean,
Expand All @@ -49,11 +45,11 @@ export const getAddEventEnrollmentServerData = ({
event: eventId,
program: programId,
programStage: formFoundation.id,
orgUnit: orgUnitId,
orgUnit: mainDataServerValues.orgUnit.id,
orgUnitName: mainDataServerValues.orgUnit.name,
trackedEntity: teiId,
enrollment: enrollmentId,
scheduledAt: mainDataServerValues.occurredAt,
orgUnitName,
updatedAt,
uid,
dataValues: Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ export const createServerData = ({
export const useBuildNewEventPayload = ({
dataEntryId,
itemId,
orgUnitId,
programId,
teiId,
enrollmentId,
orgUnitName,
formFoundation,
}: Props) => {
const { serverVersion: { minor } } = useConfig();
Expand Down Expand Up @@ -139,10 +137,8 @@ export const useBuildNewEventPayload = ({
eventId: requestEventId,
mainDataClientValues: { ...dataEntryClientValues, notes: notesValues },
programId,
orgUnitId,
enrollmentId,
teiId,
orgUnitName,
completed: saveType === addEventSaveTypes.COMPLETE,
fromClientDate,
serverMinorVersion: minor,
Expand Down

0 comments on commit 08fa169

Please sign in to comment.