Skip to content

Commit

Permalink
Fix preload
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaydimitrov committed Jan 10, 2025
1 parent e2627e8 commit a4e4994
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/video_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewVideoCall(userID uint64, groupID uint64, expiresAt int64) (vc VideoCall,

func VideoCallForUser(userID uint64) (vc VideoCall, err error) {
err = db.Instance.
Preload("User").
Where("user_id = ?", userID).
First(&vc).
Error
Expand All @@ -39,6 +40,7 @@ func VideoCallForUser(userID uint64) (vc VideoCall, err error) {

func VideoCallForGroup(userID uint64, groupID uint64) (vc VideoCall, err error) {
err = db.Instance.
Preload("User").
Where("group_id = ?", groupID).
First(&vc).
Error
Expand All @@ -50,6 +52,7 @@ func VideoCallForGroup(userID uint64, groupID uint64) (vc VideoCall, err error)

func VideoCallByID(id string) (vc VideoCall, err error) {
err = db.Instance.
Preload("User").
Where("id = ?", id).
First(&vc).
Error
Expand Down

0 comments on commit a4e4994

Please sign in to comment.