Let users browse followers and following lists
Following lists are public; followers are visible to the user and to mutual followers.
Adds GET /users/{id}/followers and /following, exposes isFollowing and canViewFollowers
on the profile, and returns isFollowedByViewer from user search so the web player no
longer calls /is-following per user.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { createApiClient } from '$lib/server/api';
|
||||
import type { FollowList } from '$lib/types';
|
||||
|
||||
type ApiClient = ReturnType<typeof createApiClient>;
|
||||
|
||||
export function fetchFollowList(
|
||||
api: ApiClient,
|
||||
list: FollowList,
|
||||
id: string,
|
||||
pageNumber: number,
|
||||
pageSize: number
|
||||
) {
|
||||
const options = { params: { path: { id }, query: { pageNumber, pageSize } } };
|
||||
return list === 'followers'
|
||||
? api.GET('/users/{id}/followers', options)
|
||||
: api.GET('/users/{id}/following', options);
|
||||
}
|
||||
Reference in New Issue
Block a user