From 215e51f764660442405b47c2620c62681ef5a057 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 26 Nov 2016 18:57:08 +0100 Subject: Move some interactions to the backendInteractor The idea is that all interactions should move there, so components don't have to pass around credentials all the time. --- src/components/conversation/conversation.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/components/conversation/conversation.js') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index ea26d958..20540ed3 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,6 +1,5 @@ import { find, filter, sortBy, toInteger } from 'lodash' import Status from '../status/status.vue' -import apiService from '../../services/api/api.service.js' const conversation = { computed: { @@ -32,12 +31,12 @@ const conversation = { fetchConversation () { if (this.status) { const conversationId = this.status.statusnet_conversation_id - apiService.fetchConversation({id: conversationId}) + this.$store.state.api.backendInteractor.fetchConversation({id: conversationId}) .then((statuses) => this.$store.dispatch('addNewStatuses', { statuses })) .then(() => this.$store.commit('updateTimestamps')) } else { const id = this.$route.params.id - apiService.fetchStatus({id}) + this.$store.state.api.backendInteractor.fetchStatus({id}) .then((status) => this.$store.dispatch('addNewStatuses', { statuses: [status] })) .then(() => this.fetchConversation()) } -- cgit v1.2.3-70-g09d2