aboutsummaryrefslogtreecommitdiff
path: root/src/components/who_to_follow_panel
diff options
context:
space:
mode:
authorHakaba Hitoyo <hakabahitoyo@example.com>2018-08-02 18:34:12 +0900
committerHakaba Hitoyo <hakabahitoyo@example.com>2018-08-02 18:34:12 +0900
commit5900bccff3f09be6bfbfa4a891c91ee043e3a9f0 (patch)
treeb5227876811c1282426c81a598a97283f0b9f042 /src/components/who_to_follow_panel
parentbcd499c3725d620bc9d4612e04add76cf7a4e395 (diff)
debug
Diffstat (limited to 'src/components/who_to_follow_panel')
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.js19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index be9a9f31..5e85b95d 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -1,4 +1,6 @@
-function showWhoToFollow (panel, reply, aHost, aUser) {
+import apiService from '../../services/api/api.service.js'
+
+function showWhoToFollow (panel, reply) {
var users = reply.ids
var cn
var index = 0
@@ -58,17 +60,10 @@ function getWhoToFollow (panel) {
panel.name2 = 'Loading...'
panel.name3 = 'Loading...'
var url = '/api/v1/suggestions'
- window.fetch(url, {headers: authHeaders(credentials)}).then(function (response) {
- if (response.ok) {
- return response.json()
- } else {
- panel.name1 = ''
- panel.name2 = ''
- panel.name3 = ''
- }
- }).then(function (reply) {
- showWhoToFollow(panel, reply, host, user)
- })
+ apiService.suggestions ({credentials: credentials})
+ .then ((reply) => {
+ showWhoToFollow(panel, reply)
+ })
}
}