Example #1
0
 public ObjectResult ChangeCategory([FromForm] string materialName, [FromForm] string newCategory)
 {
     try
     {
         var ans = _materialsService.ChangeCategory(new MaterialDto {
             materialName = materialName,
             category     = newCategory
         });
         return(Ok(ans));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }