ih-black-lion
Version:
State handler for Arus projects
26 lines (21 loc) • 699 B
JavaScript
import Connector from './Connector';
const URLS = {
tryURL: __LOV_URL__,
catchURL: process.env.LOV_URL,
};
export default class UCIDLookupConnector extends Connector {
constructor(requestMethod, requestParams, Model, searchTerm,
extraParam = undefined) {
super(requestMethod, requestParams, Model, URLS, extraParam);
if (this.searchTerm) {
this.params.url += this.searchTerm;
}
}
checkTypes() {
super.checkTypes();
if (this.searchTerm && typeof this.searchTerm !== 'string') {
return Promise.reject(new TypeError(`Type of searchTerm is ${typeof this.searchTerm}. Expected a string\n\tsearchTerm = ${this.searchTerm}`));
}
return true;
}
}