|
|
@ -1,4 +1,4 @@ |
|
|
|
import { UITypes } from 'nocodb-sdk'; |
|
|
|
import { MetaType, UITypes } from 'nocodb-sdk'; |
|
|
|
import Noco from '../Noco'; |
|
|
|
import Noco from '../Noco'; |
|
|
|
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; |
|
|
|
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; |
|
|
|
import NocoCache from '../cache/NocoCache'; |
|
|
|
import NocoCache from '../cache/NocoCache'; |
|
|
@ -26,6 +26,7 @@ export default class GalleryView implements GalleryType { |
|
|
|
base_id?: string; |
|
|
|
base_id?: string; |
|
|
|
|
|
|
|
|
|
|
|
columns?: GalleryColumnType[]; |
|
|
|
columns?: GalleryColumnType[]; |
|
|
|
|
|
|
|
meta?: MetaType; |
|
|
|
|
|
|
|
|
|
|
|
constructor(data: GalleryView) { |
|
|
|
constructor(data: GalleryView) { |
|
|
|
Object.assign(this, data); |
|
|
|
Object.assign(this, data); |
|
|
@ -95,16 +96,12 @@ export default class GalleryView implements GalleryType { |
|
|
|
// get existing cache
|
|
|
|
// get existing cache
|
|
|
|
const key = `${CacheScope.GALLERY_VIEW}:${galleryId}`; |
|
|
|
const key = `${CacheScope.GALLERY_VIEW}:${galleryId}`; |
|
|
|
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT); |
|
|
|
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT); |
|
|
|
const updateObj = extractProps(body, [ |
|
|
|
|
|
|
|
'next_enabled', |
|
|
|
const updateObj = extractProps(body, ['fk_cover_image_col_id', 'meta']); |
|
|
|
'prev_enabled', |
|
|
|
if (updateObj.meta && typeof updateObj.meta === 'object') { |
|
|
|
'cover_image_idx', |
|
|
|
updateObj.meta = JSON.stringify(updateObj.meta ?? {}); |
|
|
|
'cover_image', |
|
|
|
} |
|
|
|
'restrict_types', |
|
|
|
|
|
|
|
'restrict_size', |
|
|
|
|
|
|
|
'restrict_number', |
|
|
|
|
|
|
|
'fk_cover_image_col_id', |
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
if (o) { |
|
|
|
if (o) { |
|
|
|
o = { ...o, ...updateObj }; |
|
|
|
o = { ...o, ...updateObj }; |
|
|
|
// set cache
|
|
|
|
// set cache
|
|
|
|