The idea is that all interactions should move there, so components don't have to pass around credentials all the time.environments/dev/deployments/1
parent
b1f9f6395c
commit
215e51f764
@ -0,0 +1,14 @@
|
||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||
|
||||
const api = {
|
||||
state: {
|
||||
backendInteractor: backendInteractorService()
|
||||
},
|
||||
mutations: {
|
||||
setBackendInteractor (state, backendInteractor) {
|
||||
state.backendInteractor = backendInteractor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default api
|
@ -0,0 +1,20 @@
|
||||
import apiService from '../api/api.service.js'
|
||||
|
||||
const backendInteractorService = (credentials) => {
|
||||
const fetchStatus = ({id}) => {
|
||||
return apiService.fetchStatus({id, credentials})
|
||||
}
|
||||
|
||||
const fetchConversation = ({id}) => {
|
||||
return apiService.fetchConversation({id, credentials})
|
||||
}
|
||||
|
||||
const backendInteractorServiceInstance = {
|
||||
fetchStatus,
|
||||
fetchConversation
|
||||
}
|
||||
|
||||
return backendInteractorServiceInstance
|
||||
}
|
||||
|
||||
export default backendInteractorService
|
Loading…
Reference in new issue