mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
added /api/resource/{id} route to fancy
stopped scheduler from running during integration tests.
This commit is contained in:
@@ -145,6 +145,14 @@ namespace NzbDrone.Api.REST
|
||||
var resource = UpdateResource(ReadFromRequest());
|
||||
return resource.AsResponse(HttpStatusCode.Accepted);
|
||||
};
|
||||
|
||||
Put[ID_ROUTE] = options =>
|
||||
{
|
||||
var model = ReadFromRequest();
|
||||
model.Id = options.Id;
|
||||
var resource = UpdateResource(model);
|
||||
return resource.AsResponse(HttpStatusCode.Accepted);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +161,11 @@ namespace NzbDrone.Api.REST
|
||||
//TODO: handle when request is null
|
||||
var resource = Request.Body.FromJson<TResource>();
|
||||
|
||||
if (resource == null)
|
||||
{
|
||||
throw new BadRequestException("Request body can't be empty");
|
||||
}
|
||||
|
||||
var errors = SharedValidator.Validate(resource).Errors.ToList();
|
||||
|
||||
if (Request.Method.Equals("POST", StringComparison.InvariantCultureIgnoreCase))
|
||||
|
Reference in New Issue
Block a user