import { IReelResponse , IReelResult } from '../types/reel-page' ; import { HTTP , buildURL , NETWORK_BAN_MESSAGE } from '../utils' ; example export const getMediaByReelId = async ( reelId ) : Promise < IReelResult > => { const result = { reel : null , } ; const url = buildURL ( `reel/${ reelId }/` ) ; const response = await HTTP < IReelResponse > ( url ) ; const content = response ?. entry_data ?. PostPage ; if ( content ) { const { shortcode_media = null } = { ... content ?. [ 0 ] ?. graphql } ; result . reel = shortcode_media ; } else { throw new Error ( NETWORK_BAN_MESSAGE ) ; } return result ; } ; export default getMediaByReelId ;