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