public IActionResult RegisterPet(PetsUserViewModel vm) { var user = authProvider.GetCurrentUser(); vm.User = userDAL.GetUserById(user.Id); vm.Pet.UserId = vm.User.Id; petDAO.AddPet(vm.Pet); return(RedirectToAction("Index", "Account")); }
public ActionResult AddPet(Pet pet) { bool result = petDAO.AddPet(pet); if (result) { return(Ok()); } else { return(BadRequest()); } }