4902 bug fix fix api filter for enum (#4909)

- Handle NUMERIC, SELECT, PROBABILITY, RATING FieldMetadataTypes

Those filters now works:
- http://localhost:3000/rest/opportunities?filter=stage[eq]:MEETING
-
http://localhost:3000/rest/opportunities?filter=stage[in]:[MEETING,NEW]

When providing wrong enum values, the following error messages are
returned:
- http://localhost:3000/rest/opportunities?filter=stage[eq]:MEETINGG
> BadRequestException: 'filter' enum value 'MEETINGG' not available in
'stage' enum. Available enum values are ['NEW', 'SCREENING', 'MEETING',
'PROPOSAL', 'CUSTOMER']
-
http://localhost:3000/rest/opportunities?filter=stage[in]:[MEETING,NEWW]
> BadRequestException: 'filter' enum value 'NEWW' not available in
'stage' enum. Available enum values are ['NEW', 'SCREENING', 'MEETING',
'PROPOSAL', 'CUSTOMER']
This commit is contained in:
martmull
2024-04-10 18:54:55 +02:00
committed by GitHub
parent cfcc93dee1
commit 01991fe717
7 changed files with 122 additions and 6 deletions

View File

@ -11,6 +11,7 @@ describe('computeSchemaComponents', () => {
).toEqual({
ObjectName: {
type: 'object',
description: undefined,
required: ['fieldNumber'],
example: { fieldNumber: '' },
properties: {
@ -31,6 +32,9 @@ describe('computeSchemaComponents', () => {
fieldNumber: {
type: 'number',
},
fieldSelect: {
type: 'string',
},
fieldString: {
type: 'string',
},