From 3f50259122d5354b346c66e242f57b5993b3de2f Mon Sep 17 00:00:00 2001 From: Adam French Date: Wed, 10 Dec 2025 05:46:53 +0000 Subject: [PATCH] bugfix --- backend/models/post.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/models/post.go b/backend/models/post.go index 3a0013a..aee0b5b 100644 --- a/backend/models/post.go +++ b/backend/models/post.go @@ -6,6 +6,6 @@ type Post struct { gorm.Model // includes ID, CreatedAt, UpdatedAt, DeletedAt Title string `gorm:"not null" json:"title"` AuthorID uint `json:"-"` - Author User `gorm:"foreignKey:AuthorID,constraint:OnUpdate:CASCADE,OnDelete:SET NULL" json:"author"` + Author *User `gorm:"foreignKey:AuthorID" json:"author"` Content string `json:"content"` }