diff --git a/pkg/internal/models/events.go b/pkg/internal/models/events.go index d4d6bc0..50b08c4 100644 --- a/pkg/internal/models/events.go +++ b/pkg/internal/models/events.go @@ -21,9 +21,7 @@ type Event struct { Channel Channel `json:"channel"` Sender ChannelMember `json:"sender"` QuoteEventID *uint `json:"quote_event_id,omitempty"` - QuoteEvent *Event `json:"quote_event,omitempty" gorm:"foreignKey:QuoteEventID"` RelatedEventID *uint `json:"related_event_id,omitempty"` - RelatedEvent *Event `json:"related_event,omitempty" gorm:"foreignKey:RelatedEventID"` ChannelID uint `json:"channel_id"` SenderID uint `json:"sender_id"` } diff --git a/pkg/internal/services/messages.go b/pkg/internal/services/messages.go index 57d82c9..8f1ba04 100644 --- a/pkg/internal/services/messages.go +++ b/pkg/internal/services/messages.go @@ -38,7 +38,8 @@ func EditMessage(event models.Event, body models.EventMessageBody) (models.Event } func DeleteMessage(event models.Event) (models.Event, error) { - _, err := DeleteEvent(event) + clonedEvent := event + _, err := DeleteEvent(clonedEvent) if err != nil { return event, err }