Skip to content

Commit a0ae8ed

Browse files
committed
Hotfix api incompatability
1 parent f249f57 commit a0ae8ed

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

API/Controller/Devices/DevicesController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ public async Task<IActionResult> GetLiveControlGatewayInfo([FromRoute] Guid devi
244244
var online = await devicesOnline.FindByIdAsync(deviceId.ToString());
245245
if (online is null) return Problem(HubError.HubIsNotOnline);
246246

247-
// Check if device is connected to a LCG node
248-
if (online.Gateway is null) return Problem(HubError.HubNotConnectedToGateway);
249-
250247
// Get LCG node info
251248
var lcgNodes = _redis.RedisCollection<LcgNode>();
252249
var gateway = await lcgNodes.FindByIdAsync(online.Gateway);

Common/Errors/HubError.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ namespace OpenShock.Common.Errors;
66

77
public static class HubError
88
{
9-
public static OpenShockProblem HubNotFound => new("Hub.NotFound", "Hub not found", HttpStatusCode.NotFound);
10-
public static OpenShockProblem HubIsNotOnline => new("Hub.NotOnline", "Hub is not online", HttpStatusCode.NotFound);
11-
public static OpenShockProblem HubNotConnectedToGateway => new("Hub.NotConnectedToGateway", "Hub is not connected to a gateway", HttpStatusCode.PreconditionFailed, "Hub is online but not connected to a LCG node, you might need to upgrade your firmware to use this feature");
12-
13-
public static OpenShockProblem TooManyHubs => new("Hub.TooManyHubs", "You have too many hubs", HttpStatusCode.Conflict, $"You have reached the maximum number of shockers for this hub ({HardLimits.MaxHubsPerUser})");
14-
public static OpenShockProblem TooManyShockers => new("Hub.TooManyShockers", "Hub has too many shockers", HttpStatusCode.BadRequest, $"You have reached the maximum number of shockers for this hub ({HardLimits.MaxShockersPerHub})");
9+
public static OpenShockProblem HubNotFound => new("Device.NotFound", "Hub not found", HttpStatusCode.NotFound);
10+
public static OpenShockProblem HubIsNotOnline => new("Device.NotOnline", "Hub is not online", HttpStatusCode.NotFound);
11+
public static OpenShockProblem TooManyHubs => new("Device.TooManyHubs", "You have too many hubs", HttpStatusCode.Conflict, $"You have reached the maximum number of shockers for this hub ({HardLimits.MaxHubsPerUser})");
12+
public static OpenShockProblem TooManyShockers => new("Device.TooManyShockers", "Hub has too many shockers", HttpStatusCode.BadRequest, $"You have reached the maximum number of shockers for this hub ({HardLimits.MaxShockersPerHub})");
1513

1614
}

0 commit comments

Comments
 (0)