Update callback of post deletion.

This commit is contained in:
Pierre 2018-01-12 06:39:58 +01:00
parent f675d2ae03
commit 756b097138

View File

@ -198,7 +198,21 @@ ComunicWeb.components.posts.ui = {
//Delete the post //Delete the post
ComunicWeb.components.posts.interface.delete(infos.ID, function(response){ ComunicWeb.components.posts.interface.delete(infos.ID, function(response){
postRoot.style.visibility = "visible"; //Check for error
if(response.error){
//Display an error
ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to delete post !", "danger");
//Make the post visible
postRoot.style.visibility = "visible";
return;
}
//Delete the post
emptyElem(postRoot);
postRoot.remove();
}); });
}); });