fixed deleting

This commit is contained in:
jeena 2013-09-09 08:31:25 +02:00
parent e8392eff7a
commit 61a2199fe3
4 changed files with 14 additions and 7 deletions

View file

@ -503,8 +503,13 @@ function(jQuery, APICalls, URI, HostApp, Markdown) {
Core.prototype.remove = function(id, callback, type) {
type = type || "post";
if (confirm("Really delete this " + type + "?")) {
var url = URI(APICalls.mkApiRootPath("/posts/" + id));
APICalls.http_call(url.toString(), "DELETE", callback);
var entity = HostApp.stringForKey("entity");
var url = HostApp.serverUrl("post")
.replace(/\{entity\}/, encodeURIComponent(entity))
.replace(/\{post\}/, id);
APICalls.delete(url, { callback: callback });
}
}