fix issue rendering error

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1397247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-10-11 19:26:02 +00:00
parent deb9f97bcb
commit 7219873f2d
2 changed files with 5 additions and 1 deletions

View File

@ -233,7 +233,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
displaySuccessMessage( $.i18n.prop('artifact.deleted')); displaySuccessMessage( $.i18n.prop('artifact.deleted'));
}, },
error:function(data){ error:function(data){
displayRestError(data,"user-messages"); displayRestError( data,"user-messages");
}, },
complete:function(){ complete:function(){
closeDialogConfirm(); closeDialogConfirm();

View File

@ -287,6 +287,10 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
*/ */
displayRestError=function(data,idToAppend){ displayRestError=function(data,idToAppend){
$.log("displayRestError"); $.log("displayRestError");
// maybe data is just the response so test if if we have a responseText and transform it to json
if(data.responseText){
data= $.parseJSON(data.responseText);
}
if (data.redbackRestError){ if (data.redbackRestError){
displayRedbackError(archivaRestError,idToAppend) displayRedbackError(archivaRestError,idToAppend)
} }