|
|
@ -247,11 +247,14 @@ const fetchUser = ({id, credentials}) => {
|
|
|
|
.then((data) => parseUser(data))
|
|
|
|
.then((data) => parseUser(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const fetchFriends = ({id, page, credentials}) => {
|
|
|
|
const fetchFriends = ({id, page, isExport, credentials}) => {
|
|
|
|
let url = `${FRIENDS_URL}?user_id=${id}`
|
|
|
|
let url = `${FRIENDS_URL}?user_id=${id}`
|
|
|
|
if (page) {
|
|
|
|
if (page) {
|
|
|
|
url = url + `&page=${page}`
|
|
|
|
url = url + `&page=${page}`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isExport !== undefined) {
|
|
|
|
|
|
|
|
url = url + `&export=${isExport}`
|
|
|
|
|
|
|
|
}
|
|
|
|
return fetch(url, { headers: authHeaders(credentials) })
|
|
|
|
return fetch(url, { headers: authHeaders(credentials) })
|
|
|
|
.then((data) => data.json())
|
|
|
|
.then((data) => data.json())
|
|
|
|
.then((data) => data.map(parseUser))
|
|
|
|
.then((data) => data.map(parseUser))
|
|
|
|