Alexis Drai 2 years ago
parent ffee21b1a8
commit f18c14c0ec

@ -30,7 +30,8 @@ namespace cat_cafe.Controllers
public async Task<ActionResult<IEnumerable<CatDto>>> GetCats() public async Task<ActionResult<IEnumerable<CatDto>>> GetCats()
{ {
var cats = await _context.Cats.ToListAsync(); var cats = await _context.Cats.ToListAsync();
return _mapper.Map<List<CatDto>>(cats);
return Ok(_mapper.Map<List<CatDto>>(cats));
} }
@ -45,7 +46,7 @@ namespace cat_cafe.Controllers
return NotFound(); return NotFound();
} }
return _mapper.Map<CatDto>(cat); return Ok(_mapper.Map<CatDto>(cat));
} }
// PUT: api/Cats/5 // PUT: api/Cats/5

Loading…
Cancel
Save