1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fetchimg video infos

This commit is contained in:
Fedor Katurov 2020-04-19 11:55:27 +07:00
parent 1056f0ff72
commit c74ab01927
9 changed files with 60 additions and 13 deletions

11
src/redux/player/api.ts Normal file
View file

@ -0,0 +1,11 @@
import { IResultWithStatus, IEmbed } from '../types';
import { api, resultMiddleware, errorMiddleware } from '~/utils/api';
import { API } from '~/constants/api';
export const getEmbedYoutube = (
ids: string[]
): Promise<IResultWithStatus<{ items: Record<string, IEmbed> }>> =>
api
.get(API.EMBED.YOUTUBE, { params: { ids: ids.join(',') } })
.then(resultMiddleware)
.catch(errorMiddleware);