mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 12:02:10 +03:00
Fix open api specs for MULTI_SELECT (#8494)
## Before ![image](https://github.com/user-attachments/assets/b7384fb3-0f32-498b-99bb-27b8c15db00c) ## After ![image](https://github.com/user-attachments/assets/a8429849-559d-4494-8636-e5a6ddda7b47)
This commit is contained in:
parent
9ac949dec8
commit
090f612c4b
@ -125,8 +125,8 @@ describe('computeSchemaComponents', () => {
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
},
|
||||
fieldMultiSelect: {
|
||||
type: 'string',
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
type: 'array',
|
||||
items: { type: 'string', enum: ['OPTION_1', 'OPTION_2'] },
|
||||
},
|
||||
fieldPosition: {
|
||||
type: 'number',
|
||||
@ -302,8 +302,8 @@ describe('computeSchemaComponents', () => {
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
},
|
||||
fieldMultiSelect: {
|
||||
type: 'string',
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
type: 'array',
|
||||
items: { type: 'string', enum: ['OPTION_1', 'OPTION_2'] },
|
||||
},
|
||||
fieldPosition: {
|
||||
type: 'number',
|
||||
@ -478,8 +478,8 @@ describe('computeSchemaComponents', () => {
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
},
|
||||
fieldMultiSelect: {
|
||||
type: 'string',
|
||||
enum: ['OPTION_1', 'OPTION_2'],
|
||||
type: 'array',
|
||||
items: { type: 'string', enum: ['OPTION_1', 'OPTION_2'] },
|
||||
},
|
||||
fieldPosition: {
|
||||
type: 'number',
|
||||
|
@ -115,8 +115,18 @@ const getSchemaComponentsProperties = ({
|
||||
let itemProperty = {} as Property;
|
||||
|
||||
switch (field.type) {
|
||||
case FieldMetadataType.SELECT:
|
||||
case FieldMetadataType.MULTI_SELECT:
|
||||
itemProperty = {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
enum: field.options.map(
|
||||
(option: { value: string }) => option.value,
|
||||
),
|
||||
},
|
||||
};
|
||||
break;
|
||||
case FieldMetadataType.SELECT:
|
||||
itemProperty = {
|
||||
type: 'string',
|
||||
enum: field.options.map((option: { value: string }) => option.value),
|
||||
|
Loading…
Reference in New Issue
Block a user