Allow args to be passed to reverser
This commit is contained in:
parent
87f3fb9882
commit
bdfad83ad7
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue