update all responses sending with OkAsync

This commit is contained in:
2026-03-11 17:54:32 +01:00
parent 47c2f78e74
commit 4f52093742
20 changed files with 20 additions and 20 deletions
@@ -39,6 +39,6 @@ public class UnlockAchievementEndpoint(
}
await userAchievementsRepository.AddAsync(mapper.Map<UserAchievement>(req), ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -40,6 +40,6 @@ public class AcceptFriendRequestEndpoint(UserService userService, UserFriendsRep
await userFriendsRepository.AddAsync(friend, ct);
await userFriendsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -32,6 +32,6 @@ public class DeleteFriendEndpoint(UserFriendsRepository userFriendsRepository, U
await userFriendsRepository.DeleteAsync(userFriend, ct);
await userFriendsRepository.DeleteAsync(friendUser, ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -30,6 +30,6 @@ public class RejectFriendRequestEndpoint(UserService userService, UserFriendsRep
}
await userFriendsRepository.DeleteAsync(userFriend, ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -34,6 +34,6 @@ public class SendFriendRequestEndpoint(UserFriendsRepository userFriendsReposito
userFriend.IsAccepted = false;
await userFriendsRepository.AddAsync(userFriend, ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -60,6 +60,6 @@ public class CreateGroupEndpoint(
await userGroupsRepository.AddRangeAsync(group.UserGroups!, ct);
await userGroupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -44,6 +44,6 @@ public class DeleteGroupEndpoint(GroupsRepository groupsRepository, UserGroupsRe
await groupsRepository.DeleteAsync(group, ct);
await userGroupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -39,6 +39,6 @@ public class DeleteUserFromGroupEndpoint(UserGroupsRepository userGroupsReposito
await userGroupsRepository.DeleteAsync(member, ct);
await userGroupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -29,6 +29,6 @@ public class PatchGroupStatusEndpoint(GroupsRepository groupsRepository) : Endpo
group.IsFinished = true;
await groupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -49,6 +49,6 @@ public class PatchGroupUserProofEndpoint(UserGroupsRepository userGroupsReposito
await hubContext.Clients.Group($"group-{req.GroupId}").SendAsync("ReceiveProof", req.Proof, cancellationToken: ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -38,6 +38,6 @@ public class PatchGroupUserRoleEndpoint(UserGroupsRepository userGroupsRepositor
member.Grade = "Admin";
await userGroupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -44,6 +44,6 @@ public class PatchVoteEndpoint(UserGroupsRepository userGroupsRepository, UserSe
member.VotedProofId = req.VotedProofId;
await userGroupsRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -53,6 +53,6 @@ public class StartVoteEndpoint(UserGroupsRepository userGroupsRepository, Groups
}
await hubContext.Clients.Group($"group-{req.Id}").SendAsync("StartVote", cancellationToken: ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -30,6 +30,6 @@ public class DeleteMessageEndpoint(MessagesRepository messagesRepository) : Endp
await messagesRepository.DeleteAsync(message, ct);
await messagesRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -27,6 +27,6 @@ public class SendMessageEndpoint(UserService userService, AutoMapper.IMapper map
await hubContext.Clients.Group($"group-{req.GroupId}").SendAsync("ReceiveMessage", message, cancellationToken: ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -40,6 +40,6 @@ public class CreateUserEndpoint(UsersRepository usersRepository, AutoMapper.IMap
user.Series = 0;
await usersRepository.AddAsync(user, ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -17,6 +17,6 @@ public class DeleteUserEndpoint(UsersRepository usersRepository, UserService use
int userId = userService.GetUserIdFromToken();
await usersRepository.DeleteAsync((await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct))!, ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -29,6 +29,6 @@ public class PatchUserDesignationEndpoint(UsersRepository usersRepository, UserS
mapper.Map(req, user);
await usersRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -31,6 +31,6 @@ public class PatchUserPasswordEndpoint(UsersRepository usersRepository, UserServ
user.Password = BCrypt.Net.BCrypt.HashPassword(req.Password + salt);
await usersRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}
@@ -38,6 +38,6 @@ public class UpdateUserEndpoint(UsersRepository usersRepository, UserService use
mapper.Map(req, user);
await usersRepository.SaveChangesAsync(ct);
await Send.OkAsync(ct);
await Send.NoContentAsync(ct);
}
}