public IActionResult Contact([FromBody] ContactVm model)
 {
     if (ModelState.IsValid)
     {
         return(Ok(_freelancer.Contact(model)));
     }
     else
     {
         return(BadRequest("Error contact failure"));
     }
 }
Exemplo n.º 2
0
 public IActionResult Contact([FromBody] ContactVm model)
 {
     if (ModelState.IsValid)
     {
         var user = _freelancer.GetByIdUser(model.FromId);
         try
         {
             model.FreelancerId = user.Id;
         }
         catch (Exception)
         {
             model.FreelancerId = 0;
         }
         return(Ok(_freelancer.Contact(model)));
     }
     else
     {
         return(BadRequest("Error contact failure"));
     }
 }