fix: 下载管理可以删除未在进行中的任务
This commit is contained in:
@@ -35,6 +35,7 @@ export interface DownloadJob {
|
||||
csvPath: string;
|
||||
failures: { id: string; message: string }[];
|
||||
createdAt: string;
|
||||
stopping?: boolean;
|
||||
}
|
||||
|
||||
export function loadMeta() {
|
||||
@@ -72,6 +73,11 @@ export function pauseJob(id: string) {
|
||||
return api<DownloadJob>(`/api/download/jobs/${id}/pause`, { method: "POST" });
|
||||
}
|
||||
|
||||
export function deleteJob(id: string, files: boolean) {
|
||||
const flag = files ? "true" : "false";
|
||||
return api<unknown>(`/api/download/jobs/${encodeURIComponent(id)}?files=${flag}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
export function loadDownloadSettings() {
|
||||
return api<{ maxConcurrentJobs: number }>("/api/download/settings");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user