We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce62c96 commit f2e37dfCopy full SHA for f2e37df
internal/models/post.go
@@ -28,10 +28,12 @@ type Post struct {
28
ViewsCount int `json:"views_count" gorm:"default:0"`
29
UserID uint `json:"user_id"`
30
ClubID uint `json:"club_id"`
31
+
32
+ Club Club `json:"club" gorm:"foreignKey:ClubID"`
33
User User `json:"user" gorm:"foreignKey:UserID"`
34
Comments []Comment `json:"comments,omitempty" gorm:"foreignKey:PostID"`
35
Likes []PostLike `json:"likes,omitempty" gorm:"foreignKey:PostID"`
-
36
37
CreatedAt time.Time `json:"created_at"`
38
UpdatedAt time.Time `json:"updated_at"`
39
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
0 commit comments