Skip to content

Commit b3745bb

Browse files
committed
fix(event-types): clarify delete-blocked error message
"event type has existing bookings" reads like cancelling all bookings should unblock deletion, but bookings.event_type_id is ON DELETE RESTRICT by design (historical record — cancelling only changes status, it never removes the row). Spell that out so it doesn't look like a bug.
1 parent aa4cbe8 commit b3745bb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/handler/event_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ func (h *Handler) DeleteEventType(w http.ResponseWriter, r *http.Request) {
711711
`DELETE FROM event_types WHERE slug = ? AND user_id = ?`, slug, user.ID)
712712
if err != nil {
713713
if strings.Contains(err.Error(), "FOREIGN KEY constraint failed") {
714-
h.writeError(w, http.StatusConflict, "event type has existing bookings")
714+
h.writeError(w, http.StatusConflict, "this event type has bookings in its history (including cancelled ones) and can't be deleted — deactivate it instead")
715715
return
716716
}
717717
h.logger.ErrorContext(r.Context(), "delete event type", "error", err)

0 commit comments

Comments
 (0)