From 10dfe63b9cd3be904ff6c3cfcbb976071d69fa0a Mon Sep 17 00:00:00 2001 From: zznty <94796179+zznty@users.noreply.github.com> Date: Thu, 21 Jul 2022 22:03:20 +0700 Subject: [PATCH] fix stop server request serialization --- TorchRemote.Models/Requests/StopServerRequest.cs | 2 +- TorchRemote.Plugin/Controllers/ServerController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TorchRemote.Models/Requests/StopServerRequest.cs b/TorchRemote.Models/Requests/StopServerRequest.cs index 31a6f26..f38bdbd 100644 --- a/TorchRemote.Models/Requests/StopServerRequest.cs +++ b/TorchRemote.Models/Requests/StopServerRequest.cs @@ -1,3 +1,3 @@ namespace TorchRemote.Models.Requests; -public record StopServerRequest(bool Save = true); +public record StopServerRequest(bool Save); diff --git a/TorchRemote.Plugin/Controllers/ServerController.cs b/TorchRemote.Plugin/Controllers/ServerController.cs index 177544b..a08afbf 100644 --- a/TorchRemote.Plugin/Controllers/ServerController.cs +++ b/TorchRemote.Plugin/Controllers/ServerController.cs @@ -34,7 +34,7 @@ public class ServerController : WebApiController } [Route(HttpVerbs.Post, $"{RootPath}/stop")] - public async Task Stop(StopServerRequest request) + public async Task Stop([JsonData] StopServerRequest request) { if (!Statics.Torch.IsRunning) throw HttpException.BadRequest($"Server can't stop in state {Statics.Torch.State}", Statics.Torch.State);