mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-25 06:11:20 -04:00
FIX: Errors raised for recovering post not being handled.
This commit is contained in:
parent
019191a944
commit
33260f3203
1 changed files with 6 additions and 1 deletions
|
@ -162,7 +162,9 @@ const Post = RestModel.extend({
|
||||||
|
|
||||||
// Recover a deleted post
|
// Recover a deleted post
|
||||||
recover() {
|
recover() {
|
||||||
const post = this;
|
const post = this,
|
||||||
|
initProperties = post.getProperties('deleted_at', 'deleted_by', 'user_deleted', 'can_delete');
|
||||||
|
|
||||||
post.setProperties({
|
post.setProperties({
|
||||||
deleted_at: null,
|
deleted_at: null,
|
||||||
deleted_by: null,
|
deleted_by: null,
|
||||||
|
@ -178,6 +180,9 @@ const Post = RestModel.extend({
|
||||||
can_delete: true,
|
can_delete: true,
|
||||||
version: data.version
|
version: data.version
|
||||||
});
|
});
|
||||||
|
}).catch(function(error) {
|
||||||
|
popupAjaxError(error);
|
||||||
|
post.setProperties(initProperties);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue