|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { T } from 'nc-help'; |
|
|
|
|
import { validatePayload } from '../meta/api/helpers'; |
|
|
|
|
import { View } from '../models'; |
|
|
|
|
import type { ViewColumnReqType } from 'nocodb-sdk'; |
|
|
|
|
import type { ViewColumnReqType, ViewColumnUpdateReqType } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
export async function columnList(param: { viewId: string }) { |
|
|
|
|
return await View.getColumns(param.viewId); |
|
|
|
@ -31,9 +31,13 @@ export async function columnAdd(param: {
|
|
|
|
|
export async function columnUpdate(param: { |
|
|
|
|
viewId: string; |
|
|
|
|
columnId: string; |
|
|
|
|
// todo: add proper type for grid column in swagger
|
|
|
|
|
column: any; |
|
|
|
|
column: ViewColumnUpdateReqType; |
|
|
|
|
}) { |
|
|
|
|
validatePayload( |
|
|
|
|
'swagger.json#/components/schemas/ViewColumnUpdateReq', |
|
|
|
|
param.column |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const result = await View.updateColumn( |
|
|
|
|
param.viewId, |
|
|
|
|
param.columnId, |
|
|
|
|