@tipe/databox-loader
Advanced tools
Comparing version 0.3.13 to 0.3.14
{ | ||
"name": "@tipe/databox-loader", | ||
"version": "0.3.13", | ||
"version": "0.3.14", | ||
"description": "Tipe Databox Loader for talking with Databox", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -6,3 +6,3 @@ const fetch = require('node-fetch') | ||
function databoxFetch(url, key, model, action, body, methods = []) { | ||
function databoxFetch(url, headers, model, action, body, methods = []) { | ||
if (action === 'create') { | ||
@@ -14,3 +14,3 @@ console.warn('Please use createMany or createOne') | ||
headers: { | ||
'X-TIPE-AUTH': key, | ||
...headers, | ||
'Content-Type': 'application/json' | ||
@@ -25,3 +25,3 @@ }, | ||
} | ||
module.exports = function createDatabox(url, key, _models, _actions) { | ||
module.exports = function createDatabox(url, headers, _models, _actions) { | ||
_models = _models || models | ||
@@ -36,3 +36,3 @@ _actions = _actions || actions | ||
if (orm[model][action] === undefined) { | ||
orm[model][action] = databoxFetch.bind(null, url, key, model, action) | ||
orm[model][action] = databoxFetch.bind(null, url, headers, model, action) | ||
} | ||
@@ -39,0 +39,0 @@ }) |
104316