frontend, api: add ability to clear comments

This commit is contained in:
Adhityaa Chandrasekar
2019-04-13 21:02:40 -04:00
parent 65ea597c08
commit 9607c15c2b
6 changed files with 151 additions and 34 deletions

View File

@@ -149,4 +149,24 @@
});
}
// Clears the comments in a domain.
global.domainClear = function(domain, callback) {
var json = {
"ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": domain,
};
global.post(global.origin + "/api/domain/clear", json, function(resp) {
if (!resp.success) {
global.globalErrorShow(resp.message);
return;
}
if (callback !== undefined) {
callback(resp.success);
}
});
}
} (window.commento, document));