public IActionResult DeleteAnimal(int animalId, int shelterId) { var shelter = _dataAccess.GetShelterById(shelterId); var animal = _dataAccess.GetAnimalByShelterAndId(animalId, shelterId); if (shelter == null || animal == null) { return(NotFound("404 animal and/ or schelter are not found")); } _dataAccess.DeleteAnimal(animalId, shelterId); return(Ok(shelter)); }
//[Authorize] public IActionResult DoDeleteAnimal(int shelterId, int animalId) { Animal pickedAnimal = _dataAccess.DeleteAnimal(shelterId, animalId); return(pickedAnimal == default(Shared.Animal) ? (IActionResult)NotFound("No animal found with these parameters") : Ok(pickedAnimal)); }
public IActionResult DeleteAnimal(string shelterId, string animalId) { _dataAccess.DeleteAnimal(shelterId, animalId); return(Ok("Deleted Animal")); }