Skip to content

Commit

Permalink
Merge pull request #70 from michelin/fix-model-cmd
Browse files Browse the repository at this point in the history
Fix adding model command (UX)
  • Loading branch information
Sben65 authored Jan 11, 2022
2 parents c9e84ef + 5e572a7 commit 0361b0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
}
}

this.AddCommand(); // Add the last command entered, in case it wasn't already in the list
var result = await Http.PostAsync("api/DeviceModels", content);

if (result.IsSuccessStatusCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@
}
}

// Unnecessary to send the list of commands
// Add the last command entered, in case it wasn't already in the list
this.AddCommand();

// Unnecessary to send the list of commands to the controller
// TODO : Do this more effectively
DeviceModel.Commands.Clear();

Expand Down Expand Up @@ -240,7 +243,6 @@
{
if (DeviceModelCommand.Name != null && DeviceModelCommand.Frame != null && DeviceModelCommand.Port != 0)
{
// var result = Http.PostAsJsonAsync<DeviceModelCommand>("api/Commands", DeviceModelCommand);
DeviceModelCommand.CommandId = DeviceModelCommand.Name;
var response = Http.PostAsJsonAsync<DeviceModelCommand>($"api/Commands/{DeviceModel.ModelId}", DeviceModelCommand);
DeviceModel.Commands.Add(DeviceModelCommand);
Expand Down

0 comments on commit 0361b0e

Please sign in to comment.