mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 23:49:38 +00:00
Refac APIClient to return data, error and status as object
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
import APIClient from '../../functions/APIClient';
|
||||
import { DownloadResponseType } from '../../pages/Download';
|
||||
|
||||
const loadDownloadQueue = async (
|
||||
page: number,
|
||||
channelId: string | null,
|
||||
showIgnored: boolean,
|
||||
): Promise<DownloadResponseType> => {
|
||||
const loadDownloadQueue = async (page: number, channelId: string | null, showIgnored: boolean) => {
|
||||
const searchParams = new URLSearchParams();
|
||||
|
||||
if (page) searchParams.append('page', page.toString());
|
||||
@@ -14,7 +10,7 @@ const loadDownloadQueue = async (
|
||||
|
||||
const endpoint = `/api/download/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`;
|
||||
|
||||
return APIClient(endpoint);
|
||||
return APIClient<DownloadResponseType>(endpoint);
|
||||
};
|
||||
|
||||
export default loadDownloadQueue;
|
||||
|
||||
Reference in New Issue
Block a user