Browse Source

fix(api): throw not implemented if test method is not implemented

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3470/head
Pranav C 2 years ago
parent
commit
ca2fdc65ad
  1. 10
      packages/nocodb/src/lib/meta/helpers/NcPluginMgrv2.ts

10
packages/nocodb/src/lib/meta/helpers/NcPluginMgrv2.ts

@ -32,6 +32,7 @@ import Local from '../../v1-legacy/plugins/adapters/storage/Local';
import { MetaTable } from '../../utils/globals';
import { PluginCategory } from 'nocodb-sdk';
import Plugin from '../../models/Plugin';
import { NcError } from './catchError';
const defaultPlugins = [
SlackPluginConfig,
@ -240,6 +241,9 @@ class NcPluginMgrv2 {
);
const tempPlugin = new plugin.builder(Noco.ncMeta, plugin);
await tempPlugin.init(args?.input);
if (!tempPlugin?.getAdapter()?.test) NcError.notImplemented();
return tempPlugin?.getAdapter()?.test?.();
}
break;
@ -250,6 +254,9 @@ class NcPluginMgrv2 {
);
const tempPlugin = new plugin.builder(Noco.ncMeta, plugin);
await tempPlugin.init(args?.input);
if (!tempPlugin?.getAdapter()?.test) NcError.notImplemented();
return tempPlugin?.getAdapter()?.test?.();
}
break;
@ -259,6 +266,9 @@ class NcPluginMgrv2 {
);
const tempPlugin = new plugin.builder(Noco.ncMeta, plugin);
await tempPlugin.init(args?.input);
if (!tempPlugin?.getAdapter()?.test) NcError.notImplemented();
return tempPlugin?.getAdapter()?.test?.();
}
}

Loading…
Cancel
Save