From bdfad83ad77846436bf56f937462430d48c91b8f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 20 Jan 2016 18:52:04 +0000 Subject: [PATCH] Allow args to be passed to reverser --- static/src/js/helpers/reverser.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/static/src/js/helpers/reverser.js b/static/src/js/helpers/reverser.js index 0c6f502..e4420e5 100644 --- a/static/src/js/helpers/reverser.js +++ b/static/src/js/helpers/reverser.js @@ -1,11 +1,19 @@ -export default function Reverser(ident) { +export default function Reverser(ident, args) { + let body = {}; + if (ident) { + body.ident = ident; + } + if (args) { + body.args = args; + } + body = JSON.stringify(body); return fetch('/reverse/', { method: 'post', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, - body: JSON.stringify({ident}) + body }).then(function (response) { if (response.status === 302) { return response;