fix: wrong code syntax
This commit is contained in:
@@ -238,10 +238,10 @@ func (a *App) handleDeleteMailLabel(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer tx.Rollback()
|
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 {
|
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")
|
respondError(w, http.StatusInternalServerError, "failed to remove label associations")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
result, err := tx.ExecContext(ctx, `DELETE FROM mail_labels WHERE id=? AND mailbox_id=?`, labelID, mb.ID)
|
result, err := tx.ExecContext(ctx, `DELETE FROM mail_labels WHERE id=? AND mailbox_id=?`, labelID, mb.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
respondError(w, http.StatusInternalServerError, "failed to delete label")
|
respondError(w, http.StatusInternalServerError, "failed to delete label")
|
||||||
|
|||||||
Reference in New Issue
Block a user