Fix rescan "File not Found" error handling in oc-vcategories.js
This commit is contained in:
parent
6aee6dae6b
commit
b8466d362e
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue