diff --git a/src/components/Composer.vue b/src/components/Composer.vue index 445b4d1d..c87ceaf4 100644 --- a/src/components/Composer.vue +++ b/src/components/Composer.vue @@ -25,7 +25,7 @@
-
+
{{ currentUser.displayName }} @@ -237,7 +237,7 @@ export default { return 'icon-contacts-dark'; case 'direct': return 'icon-external'; - case 'private': + case 'unlisted': return 'icon-password'; } } @@ -260,9 +260,9 @@ export default { text: 'Followers' }, { - action: () => { this.switchType('private') }, - icon: this.visibilityIconClass('private'), - text: 'Private' + action: () => { this.switchType('unlisted') }, + icon: this.visibilityIconClass('unlisted'), + text: 'Unlisted' } ] } @@ -281,6 +281,13 @@ export default { switchType(type) { this.type = type; this.menuOpened = false; + }, + createPost(event) { + this.$store.dispatch('post', { + content: this.post, + type: this.type, + }).then((response) => { response.length > 0 ? $state.loaded() : $state.complete() }); + event.preventDefault() } }, data() { diff --git a/src/store/timeline.js b/src/store/timeline.js index 2b9c6c8e..2978bd59 100644 --- a/src/store/timeline.js +++ b/src/store/timeline.js @@ -41,8 +41,7 @@ const getters = { } const actions = { post(context, post) { - axios.post(OC.generateUrl('apps/social/api/v1/post')).then((response) => { - // FIXME: post composition is done in #18 + axios.post(OC.generateUrl('apps/social/api/v1/post'), {data: post}).then((response) => { let uid = '' context.commit('addPost', { uid: uid, data: response.data }) })