Return http responses for ajax requests

This commit is contained in:
Mouse Reeve
2021-09-10 08:00:31 -07:00
parent 909293bbb0
commit 3c38a64a81
4 changed files with 27 additions and 9 deletions

View File

@ -301,7 +301,10 @@ let BookWyrm = new class {
ajaxPost(form) {
return fetch(form.action, {
method : "POST",
body: new FormData(form)
body: new FormData(form),
headers: {
'Accept': 'application/json',
}
});
}