UNPKG

ih-black-lion

Version:

State handler for Arus projects

28 lines (24 loc) 724 B
import Connector from './Connector'; const URLS = { tryURL: __UCID_LOOKUP_URL__, catchURL: process.env.UCID_LOOKUP_URL, }; export default class UCIDLookupConnector extends Connector { constructor(requestMethod, requestParams, Model, searchTerm) { super(requestMethod, requestParams, Model, URLS, searchTerm); if (this.extraParam) { this.params.url += this.extraParam; } } 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; } }