Browse Source

fix(api): if cache(list) is not present skip pushing it into the list to avoid unexpected behaviour

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3569/head
Pranav C 2 years ago
parent
commit
7f7499b8fa
  1. 8
      packages/nocodb/src/lib/models/FormViewColumn.ts
  2. 8
      packages/nocodb/src/lib/models/GalleryViewColumn.ts
  3. 8
      packages/nocodb/src/lib/models/GridViewColumn.ts

8
packages/nocodb/src/lib/models/FormViewColumn.ts

@ -76,6 +76,14 @@ 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 (
(
await NocoCache.getList(CacheScope.FORM_VIEW_COLUMN, [
column.fk_view_id,
])
)?.length
)
await NocoCache.appendToList( await NocoCache.appendToList(
CacheScope.FORM_VIEW_COLUMN, CacheScope.FORM_VIEW_COLUMN,
[column.fk_view_id], [column.fk_view_id],

8
packages/nocodb/src/lib/models/GalleryViewColumn.ts

@ -72,6 +72,14 @@ export default class GalleryViewColumn {
id id
); );
// if cache is not present skip pushing it into the list to avoid unexpected behaviour
if (
(
await NocoCache.getList(CacheScope.GALLERY_VIEW_COLUMN, [
column.fk_view_id,
])
)?.length
)
await NocoCache.appendToList( await NocoCache.appendToList(
CacheScope.GALLERY_VIEW_COLUMN, CacheScope.GALLERY_VIEW_COLUMN,
[column.fk_view_id], [column.fk_view_id],

8
packages/nocodb/src/lib/models/GridViewColumn.ts

@ -93,6 +93,14 @@ export default class GridViewColumn implements GridColumnType {
await NocoCache.set(`${CacheScope.GRID_VIEW_COLUMN}:${fk_column_id}`, id); await NocoCache.set(`${CacheScope.GRID_VIEW_COLUMN}:${fk_column_id}`, id);
// if cache is not present skip pushing it into the list to avoid unexpected behaviour
if (
(
await NocoCache.getList(CacheScope.GRID_VIEW_COLUMN, [
column.fk_view_id,
])
)?.length
)
await NocoCache.appendToList( await NocoCache.appendToList(
CacheScope.GRID_VIEW_COLUMN, CacheScope.GRID_VIEW_COLUMN,
[column.fk_view_id], [column.fk_view_id],

Loading…
Cancel
Save