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? Title { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public int Duration { get; set; }
|
public int Duration { get; set; }
|
||||||
|
public int? VoteDuration { get; set; }
|
||||||
public List<CreateUserGroupDto>? UserGroups { get; set; }
|
public List<CreateUserGroupDto>? UserGroups { get; set; }
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,9 @@ public class StartVoteEndpoint(UserGroupsRepository userGroupsRepository, Groups
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group.StartedVote = DateTime.Now;
|
||||||
|
await groupsRepository.SaveChangesAsync(ct);
|
||||||
|
|
||||||
await hubContext.Clients.Group($"group-{req.Id}").SendAsync("StartVote", cancellationToken: ct);
|
await hubContext.Clients.Group($"group-{req.Id}").SendAsync("StartVote", cancellationToken: ct);
|
||||||
await Send.NoContentAsync(ct);
|
await Send.NoContentAsync(ct);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user