working get-endpoint in api!

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2023-09-19 13:57:44 +02:00
parent 0354b7c098
commit b76bf74b1b

View file

@ -32,8 +32,8 @@ public class MovieController: ControllerBase
) {
try
{
if (IsValidS(s)) return StatusCode(400, "Bad Request: Invalid title");
var movies = _context.Movies.Where(m => m.Title.Contains(s.ToLower()));
if (!IsValidS(s)) return StatusCode(400, "Bad Request: Invalid title");
var movies = _context.Movies.Where(m => m.Title.ToLower().Contains(s.ToLower()));
if (type != null) {
if (!IsValidType(type)) return StatusCode(400, "Bad Request: Invalid type");