feat(upload): allow canceling in-progress upload tasks from sidebar (#511)

* feat(upload): allow canceling in-progress upload tasks from sidebar

* fix(upload): resolve concurrent confirmation race and store counter issues on cancellation

* fix(webui): immediately remove cancelled upload files from file list view
This commit is contained in:
Yiling-J
2026-10-31 16:39:54 +08:00
committed by GitHub
parent ff3d71ed3d
commit c2348b0e68
15 changed files with 926 additions and 93 deletions
+15
View File
@@ -163,5 +163,20 @@ const route = new Hono<{ Variables: { user: User } }>()
return c.json(resp)
},
)
.post('/teams/:teamId/upload/tasks/:taskId/cancel', async (c) => {
const teamId = c.req.param('teamId')
const taskId = c.req.param('taskId')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.Team,
id: teamId,
})
const resp = await uploadService.cancelUploadTask(teamId, user.id, taskId)
return c.json(resp)
})
export default route