From e7e86fa7c66cff13f333dd8a4189e4c4d55673b7 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 6 Apr 2024 01:47:40 +0800 Subject: [PATCH] :bug: Fix friendship wrong preload --- pkg/services/friendships.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/services/friendships.go b/pkg/services/friendships.go index becb72f..1f63c50 100644 --- a/pkg/services/friendships.go +++ b/pkg/services/friendships.go @@ -14,6 +14,8 @@ func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]model Where(&models.AccountFriendship{Status: status}). Where(&models.AccountFriendship{AccountID: anyside.ID}). Or(&models.AccountFriendship{RelatedID: anyside.ID}). + Preload("Account"). + Preload("Related"). Find(&relationships).Error; err != nil { return relationships, err }