🐛 Fix cannot approve something
This commit is contained in:
parent
bc688f61d3
commit
ef55cbb32a
@ -87,6 +87,8 @@ func editFriendship(c *fiber.Ctx) error {
|
||||
}
|
||||
}
|
||||
|
||||
friendship.Status = models.FriendshipStatus(data.Status)
|
||||
|
||||
if friendship, err := services.EditFriend(friendship); err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||
} else {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user