client/posts: fix deleting posts
This commit is contained in:
parent
28bcbd33b9
commit
1f54a127d0
1 changed files with 2 additions and 4 deletions
|
@ -146,7 +146,7 @@ class Post extends events.EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
return api.delete('/post/' + this._id)
|
return api.delete('/post/' + this._id, {version: this._version})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.dispatchEvent(new CustomEvent('delete', {
|
this.dispatchEvent(new CustomEvent('delete', {
|
||||||
detail: {
|
detail: {
|
||||||
|
@ -206,9 +206,7 @@ class Post extends events.EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
removeFromFavorites() {
|
removeFromFavorites() {
|
||||||
return api.delete(
|
return api.delete('/post/' + this.id + '/favorite')
|
||||||
'/post/' + this.id + '/favorite',
|
|
||||||
{version: this._version})
|
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const prevScore = this._ownScore;
|
const prevScore = this._ownScore;
|
||||||
this._updateFromResponse(response);
|
this._updateFromResponse(response);
|
||||||
|
|
Loading…
Reference in a new issue