Change logic of vote
This commit is contained in:
@@ -36,9 +36,15 @@ public class PatchVoteEndpoint(UserGroupsRepository userGroupsRepository, UserSe
|
|||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user