embryo till sök
This commit is contained in:
@@ -25,16 +25,26 @@ namespace Bibblan.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("books")]
|
||||
public IActionResult GetBooks()
|
||||
public IActionResult GetBooks(string query = null)
|
||||
{
|
||||
var authors = _db.GetBooks(100).ToList();
|
||||
return Ok(authors);
|
||||
BookFilter filter = query != null ? new BookFilter
|
||||
{
|
||||
Query = query
|
||||
} : null;
|
||||
|
||||
var books = _db.GetBooks(100,filter).ToList();
|
||||
return Ok(books);
|
||||
}
|
||||
|
||||
[HttpGet("authors")]
|
||||
public IActionResult GetAuthors()
|
||||
public IActionResult GetAuthors(string query = null)
|
||||
{
|
||||
var authors = _db.GetAuthors(100).ToList();
|
||||
BookFilter filter = query != null ? new BookFilter
|
||||
{
|
||||
Query = query
|
||||
} : null;
|
||||
|
||||
var authors = _db.GetAuthors(100, filter).ToList();
|
||||
return Ok(authors);
|
||||
}
|
||||
|
||||
@@ -48,6 +58,13 @@ namespace Bibblan.Controllers
|
||||
return Ok(authors);
|
||||
}
|
||||
|
||||
[HttpGet("authorcover/{authorid}")]
|
||||
public IActionResult GetAuthorCover(int authorid)
|
||||
{
|
||||
//TODO: fixa vid tillfälle
|
||||
return Ok(new { desc = "picture of banana goes here"});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user