mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
Switched to type Tasks
& message cleanup
This commit is contained in:
parent
0ea19defcc
commit
e41ac9276b
@ -1,6 +1,8 @@
|
|||||||
import { Download, Task } from "../types/download";
|
import { Download, Task, Tasks } from "../types/download";
|
||||||
import { getTAUrl } from "./constants";
|
import { getTAUrl } from "./constants";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const TA_BASE_URL = getTAUrl();
|
const TA_BASE_URL = getTAUrl();
|
||||||
|
|
||||||
export const getDownloads = async (token: string, filter: boolean, pageNumber: number): Promise<Download> => {
|
export const getDownloads = async (token: string, filter: boolean, pageNumber: number): Promise<Download> => {
|
||||||
@ -108,7 +110,7 @@ export const sendMoveVideoQueuedIgnored = async (token: string, videoId: string,
|
|||||||
return response.json();
|
return response.json();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendTasks = async (token: string, task: string): Promise<Task> => {
|
export const sendTasks = async (token: string, task: Tasks): Promise<Task> => {
|
||||||
var data = {
|
var data = {
|
||||||
"run": task
|
"run": task
|
||||||
};
|
};
|
||||||
@ -123,7 +125,7 @@ export const sendTasks = async (token: string, task: string): Promise<Task> => {
|
|||||||
method: "POST"
|
method: "POST"
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error("Error running task: " + task + ".");
|
throw new Error(`Error running task: ${task}.`);
|
||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user