diff --git a/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/CreateDeviceModelPage.razor b/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/CreateDeviceModelPage.razor index 81c73e181..d5904493f 100644 --- a/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/CreateDeviceModelPage.razor +++ b/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/CreateDeviceModelPage.razor @@ -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) diff --git a/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/DeviceModelDetailPage.razor b/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/DeviceModelDetailPage.razor index cd9e5b0a0..6b7db4305 100644 --- a/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/DeviceModelDetailPage.razor +++ b/src/AzureIoTHub.Portal/Client/Pages/DeviceModels/DeviceModelDetailPage.razor @@ -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(); @@ -240,7 +243,6 @@ { if (DeviceModelCommand.Name != null && DeviceModelCommand.Frame != null && DeviceModelCommand.Port != 0) { - // var result = Http.PostAsJsonAsync("api/Commands", DeviceModelCommand); DeviceModelCommand.CommandId = DeviceModelCommand.Name; var response = Http.PostAsJsonAsync($"api/Commands/{DeviceModel.ModelId}", DeviceModelCommand); DeviceModel.Commands.Add(DeviceModelCommand);