From d89fcb149e202e174e831980bdcaeecffb93be5d Mon Sep 17 00:00:00 2001
From: Juan Fuentes <juanf@bs-mbpr28.d.ethz.ch>
Date: Tue, 28 May 2019 11:57:40 +0200
Subject: [PATCH] SSDM-7809 : Returning error messages from failed deletions
 and restorations

---
 .../views/TrashManager/TrashManagerController.js | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/TrashManager/TrashManagerController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/TrashManager/TrashManagerController.js
index 0812adfb81d..dca3ea90fbf 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/TrashManager/TrashManagerController.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/TrashManager/TrashManagerController.js
@@ -21,15 +21,23 @@ function TrashManagerController(mainController) {
 	
 	this.revertDeletions = function(deletionIds) {
 		mainController.serverFacade.revertDeletions(deletionIds, function(data) {
-			Util.showSuccess("Deletions Reverted.", function() {});
-			mainController.changeView('showTrashcanPage', null);
+		    if(data.error) {
+                Util.showError(data.error.message, null, true, true, false, true);
+            } else {
+                Util.showSuccess("Deletions Reverted.", function() {});
+                mainController.changeView('showTrashcanPage', null);
+            }
 		});
 	}
 	
 	this.deletePermanently = function(deletionIds) {
 		mainController.serverFacade.deletePermanently(deletionIds, function(data) {
-			Util.showSuccess("Permanently Deleted.");
-			mainController.changeView('showTrashcanPage', null);
+		    if(data.error) {
+		        Util.showError(data.error.message, null, true, true, false, true);
+		    } else {
+		        Util.showSuccess("Permanently Deleted.");
+                mainController.changeView('showTrashcanPage', null);
+		    }
 		});
 	}
 	
-- 
GitLab