mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 12:14:46 -04:00
Fixing int requirement
This commit is contained in:
parent
3e7ddff99e
commit
00ed7a4863
@ -26,7 +26,7 @@ namespace Kyoo.CommonApi
|
|||||||
_baseURL = configuration.GetValue<string>("public_url").TrimEnd('/');
|
_baseURL = configuration.GetValue<string>("public_url").TrimEnd('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id:int}")]
|
||||||
[Authorize(Policy = "Read")]
|
[Authorize(Policy = "Read")]
|
||||||
[JsonDetailed]
|
[JsonDetailed]
|
||||||
public async Task<ActionResult<T>> Get(int id)
|
public async Task<ActionResult<T>> Get(int id)
|
||||||
@ -113,7 +113,7 @@ namespace Kyoo.CommonApi
|
|||||||
return await _repository.Edit(ressource, resetOld);
|
return await _repository.Edit(ressource, resetOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id:int}")]
|
||||||
[Authorize(Policy = "Write")]
|
[Authorize(Policy = "Write")]
|
||||||
public async Task<ActionResult<T>> Edit(int id, [FromQuery] bool resetOld, [FromBody] T ressource)
|
public async Task<ActionResult<T>> Edit(int id, [FromQuery] bool resetOld, [FromBody] T ressource)
|
||||||
{
|
{
|
||||||
@ -139,7 +139,7 @@ namespace Kyoo.CommonApi
|
|||||||
return await _repository.Edit(ressource, resetOld);
|
return await _repository.Edit(ressource, resetOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id:int}")]
|
||||||
[Authorize(Policy = "Write")]
|
[Authorize(Policy = "Write")]
|
||||||
public async Task<IActionResult> Delete(int id)
|
public async Task<IActionResult> Delete(int id)
|
||||||
{
|
{
|
||||||
|
@ -24,14 +24,14 @@ namespace Kyoo.Api
|
|||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{showID}/season")]
|
[HttpGet("{showID:int}/season")]
|
||||||
[HttpGet("{showID}/seasons")]
|
[HttpGet("{showID:int}/seasons")]
|
||||||
[Authorize(Policy = "Read")]
|
[Authorize(Policy = "Read")]
|
||||||
public async Task<ActionResult<Page<Season>>> GetSeasons(int showID,
|
public async Task<ActionResult<Page<Season>>> GetSeasons(int showID,
|
||||||
[FromQuery] string sortBy,
|
[FromQuery] string sortBy,
|
||||||
[FromQuery] int limit,
|
|
||||||
[FromQuery] int afterID,
|
[FromQuery] int afterID,
|
||||||
[FromQuery] Dictionary<string, string> where)
|
[FromQuery] Dictionary<string, string> where,
|
||||||
|
[FromQuery] int limit = 20)
|
||||||
{
|
{
|
||||||
where.Remove("showID");
|
where.Remove("showID");
|
||||||
where.Remove("sortBy");
|
where.Remove("sortBy");
|
||||||
@ -58,9 +58,9 @@ namespace Kyoo.Api
|
|||||||
[Authorize(Policy = "Read")]
|
[Authorize(Policy = "Read")]
|
||||||
public async Task<ActionResult<Page<Season>>> GetSeasons(string slug,
|
public async Task<ActionResult<Page<Season>>> GetSeasons(string slug,
|
||||||
[FromQuery] string sortBy,
|
[FromQuery] string sortBy,
|
||||||
[FromQuery] int limit,
|
|
||||||
[FromQuery] int afterID,
|
[FromQuery] int afterID,
|
||||||
[FromQuery] Dictionary<string, string> where)
|
[FromQuery] Dictionary<string, string> where,
|
||||||
|
[FromQuery] int limit = 20)
|
||||||
{
|
{
|
||||||
where.Remove("slug");
|
where.Remove("slug");
|
||||||
where.Remove("sortBy");
|
where.Remove("sortBy");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user