diff --git a/src/lib/getDownloads.ts b/src/lib/getDownloads.ts index 3483416..492d6bd 100755 --- a/src/lib/getDownloads.ts +++ b/src/lib/getDownloads.ts @@ -1,6 +1,8 @@ -import { Download, Task } from "../types/download"; +import { Download, Task, Tasks } from "../types/download"; import { getTAUrl } from "./constants"; + + const TA_BASE_URL = getTAUrl(); export const getDownloads = async (token: string, filter: boolean, pageNumber: number): Promise => { @@ -108,7 +110,7 @@ export const sendMoveVideoQueuedIgnored = async (token: string, videoId: string, return response.json(); }; -export const sendTasks = async (token: string, task: string): Promise => { +export const sendTasks = async (token: string, task: Tasks): Promise => { var data = { "run": task }; @@ -123,7 +125,7 @@ export const sendTasks = async (token: string, task: string): Promise => { method: "POST" }); if (!response.ok) { - throw new Error("Error running task: " + task + "."); + throw new Error(`Error running task: ${task}.`); } return response.json(); }; \ No newline at end of file