public IActionResult CreateDrawer(DrawerRequest request) { if (!ModelState.IsValid) { return(BadRequest()); } _drawerRangeRepository.CreateDrawer(request); return(Ok()); }
public ActionResult <DrawerResponse> UpdateDrawer(int id, DrawerRequest request) { var countryToUpdate = _drawerRangeRepository.FindDrawerResourceById(id); if (countryToUpdate == null) { return(NotFound()); } if (!ModelState.IsValid) { return(BadRequest()); } var result = _drawerRangeRepository.UpdateDrawer(id, request); return(Ok(result)); }