Skip to content

Commit

Permalink
fix(aggregation and value type fields): do not use generated types fo…
Browse files Browse the repository at this point in the history
…r validation
  • Loading branch information
Mohammer5 committed Feb 21, 2024
1 parent 5bc8100 commit 2344994
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pages/dataElements/fields/ValueTypeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function ValueTypeField() {
values.valueType === 'MULTI_TEXT' ||
(values.optionSet?.id &&
optionSetQuery.data?.optionSets.valueType === 'MULTI_TEXT')

const options = dataElement.properties.valueType.constants
?.map((constant) => ({
value: constant,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/dataElements/form/dataElementSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const dataElementSchema = z
icon: z.string().optional(),
}),
domainType: z.union([z.literal('AGGREGATE'), z.literal('TRACKER')]),
valueType: z.nativeEnum(DataElement.valueType),
aggregationType: z.nativeEnum(DataElement.aggregationType),
valueType: z.string(),
aggregationType: z.string(),
optionSet: z.object({ id: z.string() }),
commentOptionSet: z.object({ id: z.string() }),
legendSets: z.array(z.object({ id: z.string() })),
Expand Down

0 comments on commit 2344994

Please sign in to comment.