mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
feat: add back error handling for a number of api calls
This commit is contained in:
@@ -58,7 +58,7 @@ define('admin/manage/category', [
|
||||
timeout: 5000,
|
||||
});
|
||||
updateHash = {};
|
||||
});
|
||||
}).catch(app.alertError);
|
||||
|
||||
return false;
|
||||
});
|
||||
@@ -103,7 +103,7 @@ define('admin/manage/category', [
|
||||
modal.modal('hide');
|
||||
app.alertSuccess('[[admin/manage/categories:alert.purge-success]]');
|
||||
ajaxify.go('admin/manage/categories');
|
||||
});
|
||||
}).catch(app.alertError);
|
||||
|
||||
return false;
|
||||
},
|
||||
@@ -215,7 +215,7 @@ define('admin/manage/category', [
|
||||
$('button[data-action="removeParent"]').parent().addClass('hide');
|
||||
$('button[data-action="changeParent"]').parent().addClass('hide');
|
||||
$('button[data-action="setParent"]').removeClass('hide');
|
||||
});
|
||||
}).catch(app.alertError);
|
||||
});
|
||||
$('button[data-action="toggle"]').on('click', function () {
|
||||
var $this = $(this);
|
||||
@@ -226,7 +226,7 @@ define('admin/manage/category', [
|
||||
$this.translateText(!disabled ? '[[admin/manage/categories:enable]]' : '[[admin/manage/categories:disable]]');
|
||||
$this.toggleClass('btn-primary', !disabled).toggleClass('btn-danger', disabled);
|
||||
$this.attr('data-disabled', disabled ? 0 : 1);
|
||||
});
|
||||
}).catch(app.alertError);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -287,7 +287,7 @@ define('admin/manage/category', [
|
||||
$('button[data-action="setParent"]').addClass('hide');
|
||||
var buttonHtml = '<i class="fa ' + parent.icon + '"></i> ' + parent.name;
|
||||
$('button[data-action="changeParent"]').html(buttonHtml).parent().removeClass('hide');
|
||||
});
|
||||
}).catch(app.alertError);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user