aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/post_status_form/post_status_form.js17
-rw-r--r--src/components/post_status_form/post_status_form.vue2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 2c015154..30a7cd40 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -1,4 +1,6 @@
import statusPoster from '../../services/status_poster/status_poster.service.js'
+import MediaUpload from '../media_upload/media_upload.vue'
+
import { reject, map, uniqBy } from 'lodash';
const buildMentionsString = ({user, attentions}, currentUser) => {
@@ -23,6 +25,9 @@ const PostStatusForm = {
'repliedUser',
'attentions'
],
+ components: {
+ MediaUpload
+ },
data () {
let statusText = ''
@@ -33,7 +38,8 @@ const PostStatusForm = {
return {
newStatus: {
- status: statusText
+ status: statusText,
+ files: []
}
}
},
@@ -41,11 +47,18 @@ const PostStatusForm = {
postStatus (newStatus) {
statusPoster.postStatus({
status: newStatus.status,
+ media: newStatus.files,
store: this.$store,
inReplyToStatusId: this.replyTo
})
- this.newStatus = { }
+ this.newStatus = {
+ status: '',
+ files: []
+ }
this.$emit('posted')
+ },
+ addMediaFile (fileInfo) {
+ this.newStatus.files.push(fileInfo)
}
}
}
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index d2106d5a..943bf422 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -10,7 +10,7 @@
</div>
</div>
<div class='form-bottom'>
- <media-upload files="newStatus.files"></media-upload>
+ <media-upload v-on:uploaded="addMediaFile"></media-upload>
<button type="submit" class="btn btn-default" >Submit</button>
</div>
</form>