From d9d95ff0392d1c15e53a2f990f7d6c6a33eaa3a6 Mon Sep 17 00:00:00 2001 From: David Diaz Date: Tue, 1 May 2018 11:16:23 -0600 Subject: [PATCH] WIp --- src/requestCache.js | 2 +- src/schema.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/requestCache.js b/src/requestCache.js index 56cdf0c..9a5cef7 100644 --- a/src/requestCache.js +++ b/src/requestCache.js @@ -17,7 +17,7 @@ class RequestCache { let result = this.$cache; path.split('.').forEach(part => { if (result[part] === undefined) { - throw new Error(`${path} not found in cache: `, path); + throw new Error(`${path} not found in cache.`); } result = result[part]; diff --git a/src/schema.js b/src/schema.js index cdd7967..7fa4ac7 100644 --- a/src/schema.js +++ b/src/schema.js @@ -8,8 +8,10 @@ const requestSchema = [ PAYLOAD: [Joi.object().keys(null), Joi.string()], PARAMS: 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(/payload/i, 'PAYLOAD', { override: true }) .rename(/params/i, 'PARAMS', { override: true })