Update status to match UI
This commit is contained in:
@@ -297,7 +297,7 @@ public class BotController : BaseController
|
||||
[HttpGet]
|
||||
public async Task<List<TradingBotResponse>> GetActiveBots()
|
||||
{
|
||||
return await GetBotsByStatusAsync(BotStatus.Up);
|
||||
return await GetBotsByStatusAsync(BotStatus.Running);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -328,7 +328,7 @@ public class BotController : BaseController
|
||||
return new List<TradingBotResponse>();
|
||||
}
|
||||
|
||||
var result = await _mediator.Send(new GetBotsByUserAndStatusCommand(user.Id, BotStatus.None));
|
||||
var result = await _mediator.Send(new GetBotsByUserAndStatusCommand(user.Id, BotStatus.Saved));
|
||||
return MapBotsToTradingBotResponse(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -467,7 +467,7 @@ public class BotController : BaseController
|
||||
/// </summary>
|
||||
private async Task NotifyBotSubscriberAsync()
|
||||
{
|
||||
var botsList = await GetBotsByStatusAsync(BotStatus.Up);
|
||||
var botsList = await GetBotsByStatusAsync(BotStatus.Running);
|
||||
await _hubContext.Clients.All.SendAsync("BotsSubscription", botsList);
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ public class BotController : BaseController
|
||||
return NotFound($"Bot with identifier {request.Identifier} not found or is not a trading bot");
|
||||
}
|
||||
|
||||
if (bot.Status != BotStatus.Up)
|
||||
if (bot.Status != BotStatus.Running)
|
||||
{
|
||||
return BadRequest($"Bot with identifier {request.Identifier} is not running");
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ public class DataController : ControllerBase
|
||||
}
|
||||
|
||||
// Get active bots
|
||||
var activeBots = await _mediator.Send(new GetBotsByStatusCommand(BotStatus.Up));
|
||||
var activeBots = await _mediator.Send(new GetBotsByStatusCommand(BotStatus.Running));
|
||||
var currentCount = activeBots.Count();
|
||||
|
||||
// Get previous count from cache
|
||||
@@ -345,7 +345,7 @@ public class DataController : ControllerBase
|
||||
}
|
||||
|
||||
// Get active bots
|
||||
var activeBots = await _mediator.Send(new GetBotsByStatusCommand(BotStatus.Up));
|
||||
var activeBots = await _mediator.Send(new GetBotsByStatusCommand(BotStatus.Running));
|
||||
|
||||
// Calculate PnL for each bot once and store in a list of tuples
|
||||
var botsWithPnL = activeBots
|
||||
|
||||
Reference in New Issue
Block a user