UNPKG

@amityco/ts-sdk-react-native

Version:

Amity Social Cloud Typescript SDK

39 lines (34 loc) 1.1 kB
import { getActiveClient } from '~/client/api/activeClient'; import { fireEvent } from '~/core/events'; /** * ```js * import { getSubChannelMarkers } from '@amityco/ts-sdk-react-native' * const subChannelMarkers = await getSubChannelMarkers(['sch1', 'sch2']) * ``` * * Fetches a paginable list of {@link Amity.SubChannelMarker} objects * * @param messageFeedIds the feed IDs of the {@link Amity.RawSubChannel} marker to fetch * @param page * @returns A page of {@link Amity.SubChannelMarker} objects * * @category Channel API * @async * @private */ export const getUserMessageFeedMakers = async ( channelIds: Amity.RawChannel['channelId'][], ): Promise<Amity.UserMessageFeedMarkerPayload> => { const client = getActiveClient(); client.log('channel/getUserMessageFeedMakers', channelIds); const { data } = await client.http.get<Amity.UserMessageFeedMarkerPayload>( `/api/v1/markers/user-message-feed`, { params: { channelIds, }, }, ); fireEvent('local.userMessageFeedMarker.fetched', { userMessageFeedMarker: data }); return data; };