diff --git a/backend/api/Database/Context/InitDb.cs b/backend/api/Database/Context/InitDb.cs index b6e5a5754..c492d4e63 100644 --- a/backend/api/Database/Context/InitDb.cs +++ b/backend/api/Database/Context/InitDb.cs @@ -46,12 +46,6 @@ public static class InitDb private static List GetAccessRoles() { var accessRole1 = new AccessRole - { - AccessLevel = RoleAccessLevel.USER, - RoleName = "Role.User" - }; - - var accessRole2 = new AccessRole { Installation = installations[0], AccessLevel = RoleAccessLevel.ADMIN, @@ -60,8 +54,7 @@ private static List GetAccessRoles() return new List(new[] { - accessRole1, - accessRole2 + accessRole1 }); } diff --git a/backend/api/Database/Models/AccessRole.cs b/backend/api/Database/Models/AccessRole.cs index 6c368a90f..aa0c5fedb 100644 --- a/backend/api/Database/Models/AccessRole.cs +++ b/backend/api/Database/Models/AccessRole.cs @@ -17,7 +17,7 @@ public class AccessRole [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public string Id { get; set; } - public Installation? Installation { get; set; } + public Installation Installation { get; set; } [Required] public string RoleName { get; set; } diff --git a/backend/api/Services/RobotService.cs b/backend/api/Services/RobotService.cs index 3930255b2..bb81eca6b 100644 --- a/backend/api/Services/RobotService.cs +++ b/backend/api/Services/RobotService.cs @@ -68,7 +68,7 @@ public async Task CreateFromQuery(CreateRobotQuery robotQuery) context.Entry(robotModel).State = EntityState.Unchanged; await context.Robots.AddAsync(newRobot); await ApplyDatabaseUpdate(newRobot.CurrentInstallation); - _ = signalRService.SendMessageAsync("Robot added", newRobot?.CurrentInstallation, new RobotResponse(newRobot!)); + _ = signalRService.SendMessageAsync("Robot added", newRobot!.CurrentInstallation, new RobotResponse(newRobot!)); return newRobot!; } throw new DbUpdateException("Could not create new robot in database as robot model does not exist"); diff --git a/frontend/src/components/Pages/FrontPage/RobotCards/RobotStatusSection.tsx b/frontend/src/components/Pages/FrontPage/RobotCards/RobotStatusSection.tsx index 0f2050313..17db3c697 100644 --- a/frontend/src/components/Pages/FrontPage/RobotCards/RobotStatusSection.tsx +++ b/frontend/src/components/Pages/FrontPage/RobotCards/RobotStatusSection.tsx @@ -35,7 +35,10 @@ export const RobotStatusSection = () => { } const relevantRobots = sortRobotsByStatus( enabledRobots.filter((robot) => { - return robot.currentInstallation.installationCode.toLocaleLowerCase() === installationCode.toLocaleLowerCase() + return ( + robot.currentInstallation.installationCode.toLocaleLowerCase() === + installationCode.toLocaleLowerCase() + ) }) ) setRobots(relevantRobots)