Browse Source

fix: handle null cases everywhere

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5936/head
Pranav C 2 years ago
parent
commit
e1fd58b1f6
  1. 2
      packages/nocodb/src/models/Model.ts
  2. 2
      packages/nocodb/src/models/View.ts

2
packages/nocodb/src/models/Model.ts

@ -327,8 +327,10 @@ export default class Model implements TableType {
table_name, table_name,
}, },
); );
if (modelData) {
modelData.meta = parseMetaProp(modelData); modelData.meta = parseMetaProp(modelData);
await NocoCache.set(`${CacheScope.MODEL}:${modelData.id}`, modelData); await NocoCache.set(`${CacheScope.MODEL}:${modelData.id}`, modelData);
}
// modelData.filters = await Filter.getFilterObject({ // modelData.filters = await Filter.getFilterObject({
// viewId: modelData.id // viewId: modelData.id
// }); // });

2
packages/nocodb/src/models/View.ts

@ -207,9 +207,11 @@ export default class View implements ViewType {
}, },
null, null,
); );
if (view) {
view.meta = parseMetaProp(view); view.meta = parseMetaProp(view);
await NocoCache.set(`${CacheScope.VIEW}:${fk_model_id}:default`, view); await NocoCache.set(`${CacheScope.VIEW}:${fk_model_id}:default`, view);
} }
}
return view && new View(view); return view && new View(view);
} }

Loading…
Cancel
Save