|
|
@ -100,13 +100,11 @@ export default class FormViewColumn implements FormColumnType { |
|
|
|
await NocoCache.set(`${CacheScope.FORM_VIEW_COLUMN}:${fk_column_id}`, id); |
|
|
|
await NocoCache.set(`${CacheScope.FORM_VIEW_COLUMN}:${fk_column_id}`, id); |
|
|
|
|
|
|
|
|
|
|
|
// if cache is not present skip pushing it into the list to avoid unexpected behaviour
|
|
|
|
// if cache is not present skip pushing it into the list to avoid unexpected behaviour
|
|
|
|
if ( |
|
|
|
const { list } = await NocoCache.getList(CacheScope.FORM_VIEW_COLUMN, [ |
|
|
|
( |
|
|
|
|
|
|
|
await NocoCache.getList(CacheScope.FORM_VIEW_COLUMN, [ |
|
|
|
|
|
|
|
column.fk_view_id, |
|
|
|
column.fk_view_id, |
|
|
|
]) |
|
|
|
]) |
|
|
|
)?.length |
|
|
|
|
|
|
|
) |
|
|
|
if (list.length) |
|
|
|
await NocoCache.appendToList( |
|
|
|
await NocoCache.appendToList( |
|
|
|
CacheScope.FORM_VIEW_COLUMN, |
|
|
|
CacheScope.FORM_VIEW_COLUMN, |
|
|
|
[column.fk_view_id], |
|
|
|
[column.fk_view_id], |
|
|
@ -119,10 +117,12 @@ export default class FormViewColumn implements FormColumnType { |
|
|
|
viewId: string, |
|
|
|
viewId: string, |
|
|
|
ncMeta = Noco.ncMeta |
|
|
|
ncMeta = Noco.ncMeta |
|
|
|
): Promise<FormViewColumn[]> { |
|
|
|
): Promise<FormViewColumn[]> { |
|
|
|
let viewColumns = await NocoCache.getList(CacheScope.FORM_VIEW_COLUMN, [ |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.FORM_VIEW_COLUMN, [ |
|
|
|
viewId, |
|
|
|
viewId, |
|
|
|
]); |
|
|
|
]); |
|
|
|
if (!viewColumns.length) { |
|
|
|
let { list: viewColumns } = cachedList; |
|
|
|
|
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
|
|
|
|
if (!isEmptyList && !viewColumns.length) { |
|
|
|
viewColumns = await ncMeta.metaList2( |
|
|
|
viewColumns = await ncMeta.metaList2( |
|
|
|
null, |
|
|
|
null, |
|
|
|
null, |
|
|
|
null, |
|
|
|