Browse Source

chore(nocodb): lint

pull/4941/head
Wing-Kam Wong 2 years ago
parent
commit
930a7ad0c2
  1. 18
      packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts
  2. 2
      packages/nocodb/src/lib/models/Base.ts
  3. 2
      packages/nocodb/src/lib/models/View.ts

18
packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts

@ -79,23 +79,23 @@ export async function validateCondition(filters: Filter[], data: any) {
res = data[field] !== null;
break;
case 'allof':
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).every((item) =>
(data[field]?.split(',') ?? []).includes(item)
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).every(
(item) => (data[field]?.split(',') ?? []).includes(item)
);
break;
case 'anyof':
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).some((item) =>
(data[field]?.split(',') ?? []).includes(item)
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).some(
(item) => (data[field]?.split(',') ?? []).includes(item)
);
break;
case 'nallof':
res = !(filter.value?.split(',').map((item) => item.trim()) ?? []).every((item) =>
(data[field]?.split(',') ?? []).includes(item)
);
res = !(
filter.value?.split(',').map((item) => item.trim()) ?? []
).every((item) => (data[field]?.split(',') ?? []).includes(item));
break;
case 'nanyof':
res = !(filter.value?.split(',').map((item) => item.trim()) ?? []).some((item) =>
(data[field]?.split(',') ?? []).includes(item)
res = !(filter.value?.split(',').map((item) => item.trim()) ?? []).some(
(item) => (data[field]?.split(',') ?? []).includes(item)
);
break;
case 'lt':

2
packages/nocodb/src/lib/models/Base.ts

@ -284,7 +284,7 @@ export default class Base implements BaseType {
[UITypes.Rollup]: 2,
[UITypes.ForeignKey]: 3,
[UITypes.LinkToAnotherRecord]: 4,
}
};
for (const model of models) {
for (const col of await model.getColumns(ncMeta)) {

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

@ -299,7 +299,7 @@ export default class View implements ViewType {
case ViewTypes.GRID:
await GridView.insert(
{
...(copyFromView?.view as GridView || {}),
...((copyFromView?.view as GridView) || {}),
...(view as GridView),
fk_view_id: view_id,
},

Loading…
Cancel
Save