2016-11-26 17:57:08 +00:00
|
|
|
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})
|
|
|
|
}
|
|
|
|
|
2016-11-26 20:09:41 +00:00
|
|
|
const fetchMentions = ({sinceId, username}) => {
|
|
|
|
return apiService.fetchMentions({sinceId, username, credentials})
|
|
|
|
}
|
|
|
|
|
2016-11-30 20:27:25 +00:00
|
|
|
const fetchFriends = () => {
|
|
|
|
return apiService.fetchFriends({credentials})
|
|
|
|
}
|
|
|
|
|
2017-02-13 21:55:38 +00:00
|
|
|
const fetchAllFollowing = ({username}) => {
|
|
|
|
return apiService.fetchAllFollowing({username, credentials})
|
|
|
|
}
|
|
|
|
|
2016-12-08 08:09:21 +00:00
|
|
|
const followUser = (id) => {
|
|
|
|
return apiService.followUser({credentials, id})
|
|
|
|
}
|
|
|
|
|
2016-12-23 15:45:57 +00:00
|
|
|
const unfollowUser = (id) => {
|
|
|
|
return apiService.unfollowUser({credentials, id})
|
|
|
|
}
|
|
|
|
|
2016-11-26 17:57:08 +00:00
|
|
|
const backendInteractorServiceInstance = {
|
|
|
|
fetchStatus,
|
2016-11-26 18:12:09 +00:00
|
|
|
fetchConversation,
|
2016-11-26 20:09:41 +00:00
|
|
|
fetchMentions,
|
2016-11-30 20:27:25 +00:00
|
|
|
fetchFriends,
|
2016-12-08 08:09:21 +00:00
|
|
|
followUser,
|
2016-12-23 15:45:57 +00:00
|
|
|
unfollowUser,
|
2017-02-13 21:55:38 +00:00
|
|
|
fetchAllFollowing,
|
2016-11-26 18:12:09 +00:00
|
|
|
verifyCredentials: apiService.verifyCredentials
|
2016-11-26 17:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return backendInteractorServiceInstance
|
|
|
|
}
|
|
|
|
|
|
|
|
export default backendInteractorService
|