This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / webapp / api-client / clients / FeedClient.ts
785 B 21 lines
1import { BaseClient } from './BaseClient'; 2import { GetGlobalFeedParams, GetGlobalFeedResponse } from '@semble/types'; 3 4export class FeedClient extends BaseClient { 5 async getGlobalFeed( 6 params?: GetGlobalFeedParams, 7 ): Promise<GetGlobalFeedResponse> { 8 const searchParams = new URLSearchParams(); 9 if (params?.page) searchParams.set('page', params.page.toString()); 10 if (params?.limit) searchParams.set('limit', params.limit.toString()); 11 if (params?.beforeActivityId) 12 searchParams.set('beforeActivityId', params.beforeActivityId); 13 14 const queryString = searchParams.toString(); 15 const endpoint = queryString 16 ? `/api/feeds/global?${queryString}` 17 : '/api/feeds/global'; 18 19 return this.request<GetGlobalFeedResponse>('GET', endpoint); 20 } 21}