diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js
new file mode 100644
index 00000000..42da2531
--- /dev/null
+++ b/src/components/retweet_button/retweet_button.js
@@ -0,0 +1,16 @@
+const RetweetButton = {
+ props: [ 'status' ],
+ methods: {
+ retweet () {
+ }
+ },
+ computed: {
+ classes () {
+ return {
+ 'retweeted': this.status.repeated
+ }
+ }
+ }
+}
+
+export default RetweetButton
diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue
new file mode 100644
index 00000000..ed5cb935
--- /dev/null
+++ b/src/components/retweet_button/retweet_button.vue
@@ -0,0 +1,18 @@
+
+
+
+ {{status.repeat_num}}
+
+
+
+
+
+
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 6253d334..0bf2ecde 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -1,5 +1,6 @@
import Attachment from '../attachment/attachment.vue'
import FavoriteButton from '../favorite_button/favorite_button.vue'
+import RetweetButton from '../retweet_button/retweet_button.vue'
import PostStatusForm from '../post_status_form/post_status_form.vue'
const Status = {
@@ -24,6 +25,7 @@ const Status = {
components: {
Attachment,
FavoriteButton,
+ RetweetButton,
PostStatusForm
},
methods: {
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 48c910c0..d309c495 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -37,9 +37,7 @@
-
-
-
+
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 06585ac7..d00bc0d0 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -5,6 +5,7 @@ const PUBLIC_TIMELINE_URL = '/api/statuses/public_timeline.json'
const PUBLIC_AND_EXTERNAL_TIMELINE_URL = '/api/statuses/public_and_external_timeline.json'
const FAVORITE_URL = '/api/favorites/create'
const UNFAVORITE_URL = '/api/favorites/destroy'
+const RETWEET_URL = '/api/statuses/retweet'
const STATUS_UPDATE_URL = '/api/statuses/update.json'
const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
// const CONVERSATION_URL = '/api/statusnet/conversation/';
@@ -63,6 +64,13 @@ const unfavorite = ({ id, credentials }) => {
})
}
+const retweet = ({ id, credentials }) => {
+ return fetch(`${RETWEET_URL}/${id}.json`, {
+ headers: authHeaders(credentials),
+ method: 'POST'
+ })
+}
+
const postStatus = ({credentials, status, mediaIds, inReplyToStatusId}) => {
const idsText = mediaIds.join(',')
const form = new FormData()
@@ -96,6 +104,7 @@ const apiService = {
fetchTimeline,
favorite,
unfavorite,
+ retweet,
postStatus,
uploadMedia
}