salix/modules/account/back/methods/account-linker/test.js

18 lines
468 B
JavaScript

const NotFoundError = require('vn-loopback/util/not-found-error');
module.exports = Self => {
Self.remoteMethod('test', {
description: 'Tests connector configuration',
http: {
path: `/test`,
verb: 'GET'
}
});
Self.test = async function() {
const connector = await Self.getLinker();
if (!connector) throw new NotFoundError('Linker not configured');
await connector.test();
};
};