@amityco/ts-sdk-react-native
Version:
Amity Social Cloud Typescript SDK
24 lines (21 loc) • 712 B
text/typescript
import { PaginationController } from '~/core/liveCollection/PaginationController';
export class GlobalFeedPaginationController extends PaginationController<
'post',
Amity.GlobalFeedLiveCollection
> {
async getRequest(queryParams: Amity.GlobalFeedLiveCollection, token: string | undefined) {
const { limit, resolveParent, ...params } = queryParams;
const options = token ? { token } : { limit };
const { data: queryResponse } = await this.http.get<Amity.PostPayload & Amity.Pagination>(
`/api/v4/me/global-feeds`,
{
params: {
...params,
resolveParent: resolveParent ?? true,
options,
},
},
);
return queryResponse;
}
}