This commit is contained in:
David Diaz 2018-05-01 11:16:23 -06:00
parent d7ae1cd0e3
commit d9d95ff039
2 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class RequestCache {
let result = this.$cache; let result = this.$cache;
path.split('.').forEach(part => { path.split('.').forEach(part => {
if (result[part] === undefined) { if (result[part] === undefined) {
throw new Error(`${path} not found in cache: `, path); throw new Error(`${path} not found in cache.`);
} }
result = result[part]; result = result[part];

View File

@ -8,8 +8,10 @@ const requestSchema = [
PAYLOAD: [Joi.object().keys(null), Joi.string()], PAYLOAD: [Joi.object().keys(null), Joi.string()],
PARAMS: Joi.object().keys(null), PARAMS: Joi.object().keys(null),
FORM: Joi.object().keys(null), FORM: Joi.object().keys(null),
ALIAS: Joi.string().required() ALIAS: Joi.string().required(),
FORMDATA: Joi.object().keys(null)
}) })
.or('FORM', 'PAYLOAD', 'FORMDATA')
.rename(/headers/i, 'HEADERS', { override: true }) .rename(/headers/i, 'HEADERS', { override: true })
.rename(/payload/i, 'PAYLOAD', { override: true }) .rename(/payload/i, 'PAYLOAD', { override: true })
.rename(/params/i, 'PARAMS', { override: true }) .rename(/params/i, 'PARAMS', { override: true })