Skip to content

Commit

Permalink
fix: filter.Status for friendships
Browse files Browse the repository at this point in the history
  • Loading branch information
pieceowater committed Dec 15, 2024
1 parent 7205a8b commit 01d33ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/pkg/msvc.users/friendship/ctrl/friendship.ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ func (c *FriendshipController) RemoveFriendship(input model.RemoveFriendshipInpu
}

func (c *FriendshipController) FriendshipList(filter *model.FriendshipFilter) (*model.PaginatedFriendshipList, error) {
// Default to FriendshipStatusAccepted if Status is nil
if filter.Status == nil {
// Create a variable and take the address of it
status := model.FriendshipStatusAccepted
filter.Status = &status
}

// Mapping the filter to gRPC model for pagination, search, and sorting
request := &fr.FriendshipFilter{
UserId: filter.UserID,
Expand Down

0 comments on commit 01d33ce

Please sign in to comment.