Updated dto and endpoint to manage vote

This commit is contained in:
2026-03-23 15:22:38 +01:00
parent 231c085000
commit 4879d3f38c
2 changed files with 4 additions and 0 deletions
@@ -6,5 +6,6 @@ public class CreateGroupDto
public string? Title { get; set; }
public string? Description { get; set; }
public int Duration { get; set; }
public int? VoteDuration { get; set; }
public List<CreateUserGroupDto>? UserGroups { get; set; }
}
@@ -43,6 +43,9 @@ public class StartVoteEndpoint(UserGroupsRepository userGroupsRepository, Groups
await Send.StringAsync("Le défi n'est pas encore terminé", 400, cancellation: ct);
return;
}
group.StartedVote = DateTime.Now;
await groupsRepository.SaveChangesAsync(ct);
await hubContext.Clients.Group($"group-{req.Id}").SendAsync("StartVote", cancellationToken: ct);
await Send.NoContentAsync(ct);