|
|
@ -1,4 +1,4 @@ |
|
|
|
import { UITypes } from 'nocodb-sdk'; |
|
|
|
import { RelationTypes, UITypes } from 'nocodb-sdk'; |
|
|
|
import type { Base, Column, LinkToAnotherRecordColumn } from '~/models'; |
|
|
|
import type { Base, Column, LinkToAnotherRecordColumn } from '~/models'; |
|
|
|
import SwaggerTypes from '~/db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; |
|
|
|
import SwaggerTypes from '~/db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; |
|
|
|
import Noco from '~/Noco'; |
|
|
|
import Noco from '~/Noco'; |
|
|
@ -26,8 +26,15 @@ export default async ( |
|
|
|
); |
|
|
|
); |
|
|
|
if (colOpt) { |
|
|
|
if (colOpt) { |
|
|
|
const relTable = await colOpt.getRelatedTable(ncMeta); |
|
|
|
const relTable = await colOpt.getRelatedTable(ncMeta); |
|
|
|
|
|
|
|
if (colOpt.type === RelationTypes.BELONGS_TO) { |
|
|
|
field.type = undefined; |
|
|
|
field.type = undefined; |
|
|
|
field.$ref = `#/components/schemas/${relTable.title}Request`; |
|
|
|
field.$ref = `#/components/schemas/${relTable.title}Request`; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
field.type = 'array'; |
|
|
|
|
|
|
|
field.items = { |
|
|
|
|
|
|
|
$ref: `#/components/schemas/${relTable.title}Request`, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|