Fix rescan "File not Found" error handling in oc-vcategories.js

This commit is contained in:
Bart Visscher 2012-04-13 16:12:55 +02:00
parent 6aee6dae6b
commit b8466d362e
1 changed files with 5 additions and 5 deletions

View File

@ -84,16 +84,16 @@ OCCategories={
},
rescan:function(){
console.log('Categories.rescan');
$.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),{},function(jsondata, status, xhr){
if (status == 'error' && xhr.status == 404) {
OC.dialogs.alert('The required file ' + OC.filePath(Categories.app, 'ajax', 'categories/rescan.php') + ' is not installed!', 'Error');
return;
}
$.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),function(jsondata, status, xhr){
if(jsondata.status == 'success'){
OCCategories._update(jsondata.data.categories);
} else {
OC.dialogs.alert(jsondata.data.message, 'Error');
}
}).error(function(xhr){
if (xhr.status == 404) {
OC.dialogs.alert('The required file ' + OC.filePath(Categories.app, 'ajax', 'categories/rescan.php') + ' is not installed!', 'Error');
}
});
},
_update:function(categories){