From e41ac9276b26a880801530e3accb0db2942479a6 Mon Sep 17 00:00:00 2001 From: n8detar Date: Sat, 23 Apr 2022 11:37:46 -0700 Subject: [PATCH] Switched to type `Tasks` & message cleanup --- src/lib/getDownloads.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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