add remove page
This commit is contained in:
parent
a27cefec3f
commit
3f39ec94e9
1 changed files with 25 additions and 0 deletions
|
@ -218,6 +218,31 @@ class API {
|
|||
}
|
||||
}
|
||||
|
||||
/* Delete a page
|
||||
|
||||
@args array Array => (key: string)
|
||||
@return string The page key deleted
|
||||
*/
|
||||
async deletePage(args) {
|
||||
var url = this.apiURL + "pages/" + args['key'];
|
||||
var body = this.body;
|
||||
try {
|
||||
var response = await fetch(url, {
|
||||
credentials: "same-origin",
|
||||
method: "DELETE",
|
||||
body: JSON.stringify(body),
|
||||
headers: new Headers({
|
||||
"Content-Type": "application/json"
|
||||
})
|
||||
});
|
||||
var json = await response.json();
|
||||
return json;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete the profile picture from a user
|
||||
|
||||
@args array Array => (username: string)
|
||||
|
|
Loading…
Reference in a new issue