Change logic of vote

This commit is contained in:
2026-03-23 15:44:50 +01:00
parent cad550de7f
commit beea881718
@@ -36,9 +36,15 @@ public class PatchVoteEndpoint(UserGroupsRepository userGroupsRepository, UserSe
return;
}
if (member.Group!.IsFinished)
if (member.Group!.StartedVote is not null && member.Group.StartedVote.Value.AddHours(member.Group.VoteDuration) > DateTime.Now)
{
await Send.StringAsync("Ce défi est terminé", 400, cancellation: ct);
await Send.StringAsync("Le vote est terminé", 400, cancellation: ct);
return;
}
if (member.Group!.StartedVote is null)
{
await Send.StringAsync("Le vote n'a pas commencé", 400, cancellation: ct);
return;
}