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/', {
|
return fetch('/reverse/', {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ident})
|
body
|
||||||
}).then(function (response) {
|
}).then(function (response) {
|
||||||
if (response.status === 302) {
|
if (response.status === 302) {
|
||||||
return response;
|
return response;
|
||||||
|
|
Reference in a new issue