1
Fork 0

Allow args to be passed to reverser

This commit is contained in:
Jake Howard 2016-01-20 18:52:04 +00:00
parent 87f3fb9882
commit bdfad83ad7

View file

@ -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;