Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async get(session, type, id, next) {
if (bootstrapSchema.concat(systemModels).find(m => m.type === type && m.id === id)) {
return await next();
}
if (this.params.injectFirst) {
return { data: this.makeModel(type, id, this.params.injectFirst), meta: this.makeMeta(type, id) };
}
let result = await next();
if (result) {
return result;
}
if (this.params.injectSecond) {
return { data: this.makeModel(type, id, this.params.injectSecond), meta: this.makeMeta(type, id) };
}
}