fixed error caused by 415
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
public class GetFriendRequestDto
|
||||
{
|
||||
public int FriendId { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public int Score { get; set; }
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public class AcceptFriendRequestEndpoint(UserService userService, UserFriendsRep
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/Friends/{@FriendId}/Request/", x => new { x.FriendId });
|
||||
Description(x => x.Accepts<AcceptFriendRequest>());
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(AcceptFriendRequest req, CancellationToken ct)
|
||||
|
||||
@@ -16,6 +16,7 @@ public class RejectFriendRequestEndpoint(UserService userService, UserFriendsRep
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/Friends/{@FriendId}/Request/", x => new { x.FriendId });
|
||||
Description(x => x.Accepts<RejectFriendRequest>());
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(RejectFriendRequest req, CancellationToken ct)
|
||||
|
||||
@@ -5,10 +5,10 @@ namespace BeReadyBackend.Specifications.Friends;
|
||||
|
||||
public class GetFriendRequestSpec : Specification<UserFriend>
|
||||
{
|
||||
public GetFriendRequestSpec(int friendId)
|
||||
public GetFriendRequestSpec(int userId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.User)
|
||||
.Where(x => !x.IsAccepted && x.FriendId == friendId);
|
||||
.Where(x => !x.IsAccepted && x.FriendId == userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user