Updated dto and endpoint to manage vote
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user