🐛 Fix cannot approve something

This commit is contained in:
2024-04-06 02:55:07 +08:00
parent bc688f61d3
commit ef55cbb32a
2 changed files with 4 additions and 3 deletions

View File

@ -11,9 +11,8 @@ import (
func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]models.AccountFriendship, error) {
var relationships []models.AccountFriendship
if err := database.C.
Where(&models.AccountFriendship{Status: status}).
Where(&models.AccountFriendship{AccountID: anyside.ID}).
Or(&models.AccountFriendship{RelatedID: anyside.ID}).
Where(&models.AccountFriendship{AccountID: anyside.ID, Status: status}).
Or(&models.AccountFriendship{RelatedID: anyside.ID, Status: status}).
Preload("Account").
Preload("Related").
Find(&relationships).Error; err != nil {