feat: pauses & resumes downloads

This commit is contained in:
2025-06-09 16:42:30 -05:00
parent a7bedae3db
commit 3c2092095f
12 changed files with 179 additions and 25 deletions

View File

@@ -30,7 +30,13 @@ export default class extends Controller {
}
pauseDownload(data) {
fetch(`/api/download/${data.params.id}`, {method: 'PUT'})
fetch(`/api/download/${data.params.id}/pause`, {method: 'PATCH'})
.then(res => res.json())
.then(json => console.debug(json));
}
resumeDownload(data) {
fetch(`/api/download/${data.params.id}/resume`, {method: 'PATCH'})
.then(res => res.json())
.then(json => console.debug(json));
}