Creating ClearFailedDownloads button.

This commit is contained in:
Roland 2022-04-01 16:45:59 -06:00
parent c4f511e469
commit 7ac3fbea2b
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 92 additions and 7 deletions

View file

@ -532,7 +532,7 @@ export async function importMapFiles(paths) {
}
}
export async function clearDownloads() {
export async function clearCompletedDownloads() {
let response = await apiPost(`${API_URI}/download/clear_completed`);
if (response.status === 204) {
return null
@ -540,7 +540,21 @@ export async function clearDownloads() {
toast({
type: 'error',
title: 'Error!',
description: 'Could not clear downloads! See server logs.',
description: 'Could not clear completed downloads! See server logs.',
time: 5000,
});
}
}
export async function clearFailedDownloads() {
let response = await apiPost(`${API_URI}/download/clear_failed`);
if (response.status === 204) {
return null
} else {
toast({
type: 'error',
title: 'Error!',
description: 'Could not clear failed downloads! See server logs.',
time: 5000,
});
}