mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
added /api/resource/{id} route to fancy
stopped scheduler from running during integration tests.
This commit is contained in:
parent
e8d8588199
commit
90fa261a00
5 changed files with 33 additions and 4 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue