Skip to content

Commit

Permalink
Make sure db does not create new robot on mission run create
Browse files Browse the repository at this point in the history
  • Loading branch information
Christdej committed Oct 23, 2023
1 parent fcb4b03 commit c254897
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/api/Services/MissionRunService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ private IQueryable<MissionRun> GetMissionRunsWithSubModels()

public async Task<MissionRun> Create(MissionRun missionRun)
{
// Making sure database does not try to create new robot
_context.Entry(missionRun.Robot).State = EntityState.Unchanged;
await _context.MissionRuns.AddAsync(missionRun);
await _context.SaveChangesAsync();

Expand Down

0 comments on commit c254897

Please sign in to comment.