|
|
@ -2,7 +2,7 @@ import { ViewTypes } from 'nocodb-sdk'; |
|
|
|
import { T } from 'nc-help'; |
|
|
|
import { T } from 'nc-help'; |
|
|
|
import { validatePayload } from '../../meta/api/helpers'; |
|
|
|
import { validatePayload } from '../../meta/api/helpers'; |
|
|
|
import { GalleryView, View } from '../../models'; |
|
|
|
import { GalleryView, View } from '../../models'; |
|
|
|
import type { GalleryReqType } from 'nocodb-sdk'; |
|
|
|
import type { ViewCreateReqType, GalleryUpdateReqType } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
|
|
export async function galleryViewGet(param: { galleryViewId: string }) { |
|
|
|
export async function galleryViewGet(param: { galleryViewId: string }) { |
|
|
|
return await GalleryView.get(param.galleryViewId); |
|
|
|
return await GalleryView.get(param.galleryViewId); |
|
|
@ -10,7 +10,7 @@ export async function galleryViewGet(param: { galleryViewId: string }) { |
|
|
|
|
|
|
|
|
|
|
|
export async function galleryViewCreate(param: { |
|
|
|
export async function galleryViewCreate(param: { |
|
|
|
tableId: string; |
|
|
|
tableId: string; |
|
|
|
gallery: GalleryReqType; |
|
|
|
gallery: ViewCreateReqType; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
validatePayload('swagger.json#/components/schemas/GalleryReq', param.gallery); |
|
|
|
validatePayload('swagger.json#/components/schemas/GalleryReq', param.gallery); |
|
|
|
|
|
|
|
|
|
|
@ -26,9 +26,12 @@ export async function galleryViewCreate(param: { |
|
|
|
|
|
|
|
|
|
|
|
export async function galleryViewUpdate(param: { |
|
|
|
export async function galleryViewUpdate(param: { |
|
|
|
galleryViewId: string; |
|
|
|
galleryViewId: string; |
|
|
|
gallery: GalleryReqType; |
|
|
|
gallery: GalleryUpdateReqType; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
validatePayload('swagger.json#/components/schemas/GalleryReq', param.gallery); |
|
|
|
validatePayload( |
|
|
|
|
|
|
|
'swagger.json#/components/schemas/GalleryUpdateReq', |
|
|
|
|
|
|
|
param.gallery |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
T.emit('evt', { evt_type: 'view:updated', type: 'gallery' }); |
|
|
|
T.emit('evt', { evt_type: 'view:updated', type: 'gallery' }); |
|
|
|
return await GalleryView.update(param.galleryViewId, param.gallery); |
|
|
|
return await GalleryView.update(param.galleryViewId, param.gallery); |
|
|
|