mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
player: refactored sagas
This commit is contained in:
parent
5102c738b3
commit
7d4df40963
4 changed files with 29 additions and 20 deletions
|
@ -1,11 +1,8 @@
|
|||
import { IResultWithStatus, IEmbed } from '../types';
|
||||
import { api, resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
import { api, cleanResult } from '~/utils/api';
|
||||
import { API } from '~/constants/api';
|
||||
import { ApiGetEmbedYoutubeResult } from '~/redux/player/types';
|
||||
|
||||
export const getEmbedYoutube = (
|
||||
ids: string[]
|
||||
): Promise<IResultWithStatus<{ items: Record<string, IEmbed> }>> =>
|
||||
export const getEmbedYoutube = (ids: string[]) =>
|
||||
api
|
||||
.get(API.EMBED.YOUTUBE, { params: { ids: ids.join(',') } })
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
.get<ApiGetEmbedYoutubeResult>(API.EMBED.YOUTUBE, { params: { ids: ids.join(',') } })
|
||||
.then(cleanResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue