fix: wrong code syntax

This commit is contained in:
killerprojecte
2026-06-22 20:12:56 +08:00
parent 84cc47e3cf
commit 77187e76ce
+4 -4
View File
@@ -238,10 +238,10 @@ func (a *App) handleDeleteMailLabel(w http.ResponseWriter, r *http.Request) {
return
}
defer tx.Rollback()
if (_, err := tx.ExecContext(ctx, "DELETE FROM message_labels WHERE label_id = ? AND EXISTS (SELECT 1 FROM mail_labels WHERE id = ? AND mailbox_id = ?)", labelID, labelID, mb.ID); err != nil {
respondError(w, http.StatusInternalServerError, "failed to remove label associations")
return
}
if _, err := tx.ExecContext(ctx, "DELETE FROM message_labels WHERE label_id = ? AND EXISTS (SELECT 1 FROM mail_labels WHERE id = ? AND mailbox_id = ?)", labelID, labelID, mb.ID); err != nil {
respondError(w, http.StatusInternalServerError, "failed to remove label associations")
return
}
result, err := tx.ExecContext(ctx, `DELETE FROM mail_labels WHERE id=? AND mailbox_id=?`, labelID, mb.ID)
if err != nil {
respondError(w, http.StatusInternalServerError, "failed to delete label")