Creating ClearCompleteDownloads button.

This commit is contained in:
Roland 2022-04-01 16:31:49 -06:00
parent 5178f72b66
commit c4f511e469
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
6 changed files with 99 additions and 9 deletions

View file

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