diff options
author | Jonas Sulzer <jonas@violoncello.ch> | 2019-04-22 19:56:40 +0200 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-05-03 16:31:15 -0100 |
commit | 360b69d02090a7798aeaa419d04beeda36941b4e (patch) | |
tree | 75689e6c71eee7aae4601b2ca2b69e6061dddd02 /src/store | |
parent | 055aa5865a8ab43d81a4cbf4503ef136dc66ae38 (diff) |
📦 NEW: unboost post if it was boosted previously
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/timeline.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js index 16188ef4..050e620b 100644 --- a/src/store/timeline.js +++ b/src/store/timeline.js @@ -109,6 +109,16 @@ const actions = { }) }) }, + postUnBoost(context, post) { + return axios.delete(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => { + context.commit('removeBoost', post) + // eslint-disable-next-line no-console + console.log('Boost deleted with token ' + response.data.result.token) + }).catch((error) => { + OC.Notification.showTemporary('Failed to delete the boost') + console.error('Failed to delete the boost', error) + }) + }, refreshTimeline(context) { return this.dispatch('fetchTimeline', { sinceTimestamp: Math.floor(Date.now() / 1000) + 1 }) }, |