more TODOs
This commit is contained in:
@@ -13,6 +13,7 @@ public static class RtcEndpoints
|
|||||||
public static void MapRtcEndpoints(this WebApplication app)
|
public static void MapRtcEndpoints(this WebApplication app)
|
||||||
{
|
{
|
||||||
// Join a channel call and determine whether the caller should become the offerer.
|
// Join a channel call and determine whether the caller should become the offerer.
|
||||||
|
//TODO: Remove join endpoint and redo its logic in correct locations
|
||||||
app.MapPost("/api/rtc/join", async (RtcJoinRequest request, RtcCallService rtcCallService) =>
|
app.MapPost("/api/rtc/join", async (RtcJoinRequest request, RtcCallService rtcCallService) =>
|
||||||
{
|
{
|
||||||
return Results.Ok(await rtcCallService.JoinCallAsync(request.ChannelId, request.Username));
|
return Results.Ok(await rtcCallService.JoinCallAsync(request.ChannelId, request.Username));
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public sealed class RtcCallService
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
public async Task<RtcJoinResponse> JoinCallAsync(string channelId, string username)
|
public async Task<RtcJoinResponse> JoinCallAsync(string channelId, string username)
|
||||||
{
|
{
|
||||||
|
//TODO: move active call creation logic to WriteOfferAsync Function
|
||||||
var activeCalls = await _db.Select<RtcActiveCall>("rtc_active_calls");
|
var activeCalls = await _db.Select<RtcActiveCall>("rtc_active_calls");
|
||||||
var activeCall = activeCalls.FirstOrDefault(x => x.ChannelId == channelId && x.IsActive);
|
var activeCall = activeCalls.FirstOrDefault(x => x.ChannelId == channelId && x.IsActive);
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ public sealed class RtcCallService
|
|||||||
}
|
}
|
||||||
|
|
||||||
var offers = await _db.Select<RtcOffer>("rtc_offers");
|
var offers = await _db.Select<RtcOffer>("rtc_offers");
|
||||||
var offer = offers
|
var offer = offers //TODO: Remove offer creation in C#
|
||||||
.Where(x => x.ChannelId == channelId)
|
.Where(x => x.ChannelId == channelId)
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user