Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adding model command (UX) #70

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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