fix stop server request serialization
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
namespace TorchRemote.Models.Requests;
|
namespace TorchRemote.Models.Requests;
|
||||||
|
|
||||||
public record StopServerRequest(bool Save = true);
|
public record StopServerRequest(bool Save);
|
||||||
|
@@ -34,7 +34,7 @@ public class ServerController : WebApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Route(HttpVerbs.Post, $"{RootPath}/stop")]
|
[Route(HttpVerbs.Post, $"{RootPath}/stop")]
|
||||||
public async Task Stop(StopServerRequest request)
|
public async Task Stop([JsonData] StopServerRequest request)
|
||||||
{
|
{
|
||||||
if (!Statics.Torch.IsRunning)
|
if (!Statics.Torch.IsRunning)
|
||||||
throw HttpException.BadRequest($"Server can't stop in state {Statics.Torch.State}", Statics.Torch.State);
|
throw HttpException.BadRequest($"Server can't stop in state {Statics.Torch.State}", Statics.Torch.State);
|
||||||
|
Reference in New Issue
Block a user