mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-07 14:39:24 +00:00
Refac move PlaylistType into loader and fix new response type
This commit is contained in:
@@ -1,6 +1,32 @@
|
||||
import APIClient from '../../functions/APIClient';
|
||||
|
||||
const loadPlaylistById = async (playlistId: string | undefined) => {
|
||||
export type PlaylistEntryType = {
|
||||
youtube_id: string;
|
||||
title: string;
|
||||
uploader: string;
|
||||
idx: number;
|
||||
downloaded: boolean;
|
||||
};
|
||||
|
||||
export type PlaylistType = {
|
||||
playlist_active: boolean;
|
||||
playlist_channel: string;
|
||||
playlist_channel_id: string;
|
||||
playlist_description: string;
|
||||
playlist_entries: PlaylistEntryType[];
|
||||
playlist_id: string;
|
||||
playlist_last_refresh: string;
|
||||
playlist_name: string;
|
||||
playlist_subscribed: boolean;
|
||||
playlist_thumbnail: string;
|
||||
playlist_type: string;
|
||||
_index: string;
|
||||
_score: number;
|
||||
};
|
||||
|
||||
export type PlaylistResponseType = PlaylistType;
|
||||
|
||||
const loadPlaylistById = async (playlistId: string | undefined): Promise<PlaylistResponseType> => {
|
||||
return APIClient(`/api/playlist/${playlistId}/`);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user