Skip to content

Commit

Permalink
Trigger event when manually setting robot status
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jul 25, 2024
1 parent 652c2f0 commit f601141
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/api/Controllers/RobotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Api.Controllers.Models;
using Api.Database.Models;
using Api.Services;
using Api.Services.Events;
using Api.Utilities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -360,6 +361,8 @@ [FromBody] RobotStatus robotStatus

var robotResponse = new RobotResponse(updatedRobot);

if (robotStatus == RobotStatus.Available) missionSchedulingService.TriggerRobotAvailable(new RobotAvailableEventArgs(robot.Id));

return Ok(robotResponse);
}
catch (Exception e)
Expand Down

0 comments on commit f601141

Please sign in to comment.