fix(ui): optimize comment polling and remove unused comments endpoint

This commit is contained in:
yiling
2026-05-28 10:59:08 +08:00
parent 023f256e00
commit 407b6359f2
3 changed files with 1 additions and 40 deletions
-1
View File
@@ -40,7 +40,6 @@ describe('file api', () => {
vi.spyOn(assetService, 'deleteAssets').mockImplementation(vi.fn())
vi.spyOn(assetService, 'createComment').mockImplementation(vi.fn())
vi.spyOn(assetService, 'listComments').mockImplementation(vi.fn())
vi.spyOn(assetService, 'getComment').mockImplementation(vi.fn())
vi.spyOn(assetService, 'restoreAssets').mockImplementation(vi.fn())
vi.spyOn(metadataService, 'updateAssetMetadata').mockImplementation(vi.fn())
vi.spyOn(notificationService, 'create').mockImplementation(vi.fn())
-14
View File
@@ -183,20 +183,6 @@ const route = new Hono<{ Variables: { user: User } }>()
const comments = await assetService.listComments(fileId, req)
return c.json(comments)
})
.get('/comments/:commentId', async (c) => {
const commentId = c.req.param('commentId')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Comment,
id: commentId,
})
const comment = await assetService.getComment(commentId)
return c.json(comment)
})
.post('/files/restore', zValidator('json', restoreFilesRequestSchema), async (c) => {
const user = c.get('user')
const req = c.req.valid('json')