fix: label management - transaction safety, deletion sync, error handling
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 42s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 42s
- Use prisma.$transaction in auto-label-creation.service with tx client - Fix DELETE /api/labels to properly JSON.parse + disconnect labelRelations - Fix PUT /api/labels rename to handle JSON labels - Graceful error handling in /api/ai/tags and /api/ai/auto-labels - Client-side label-deleted event in home-client, notes-tabs-view, label-management-dialog Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -50,8 +50,12 @@ export function LabelManagementDialog(props: LabelManagementDialogProps = {}) {
|
||||
|
||||
const handleDeleteLabel = async (id: string) => {
|
||||
try {
|
||||
const labelToDelete = labels.find(l => l.id === id)
|
||||
await deleteLabel(id)
|
||||
triggerRefresh()
|
||||
if (labelToDelete) {
|
||||
window.dispatchEvent(new CustomEvent('label-deleted', { detail: { name: labelToDelete.name } }))
|
||||
}
|
||||
setConfirmDeleteId(null)
|
||||
} catch (error) {
|
||||
console.error('Failed to delete label:', error)
|
||||
|
||||
Reference in New Issue
Block a user