diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-11-21 15:23:25 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-11-21 15:23:42 +0100 |
commit | 29469ef10a5f0ea8f42f9c9755a275251d81162c (patch) | |
tree | a6e0a4071943a4f9d167956949d32152dd9f4a7e /src/store | |
parent | bb1fceb801e5ba6270bd321a735822c8fafb21f9 (diff) |
Properly send to data when creating a post
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/timeline.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js index 9c89ea23..a5f0d4a5 100644 --- a/src/store/timeline.js +++ b/src/store/timeline.js @@ -32,6 +32,10 @@ const mutations = { state.since = data[item].published state.timeline.push(data[item]) } + }, + addPost(state, data) { + // FIXME: push data we receive to the timeline array + // state.timeline.push(data) } } const getters = { @@ -43,6 +47,9 @@ const actions = { post(context, post) { return axios.post(OC.generateUrl('apps/social/api/v1/post'), { data: post }).then((response) => { context.commit('addPost', { data: response.data }) + }).catch((error) => { + OC.Notification.showTemporary('Failed to create a post') + console.error('Failed to create a post', error) }) }, fetchTimeline(context, account) { |