Exemplo n.º 1
0
        public ActionResult <int> RegisterShelter(ShelterRegistrationModel shelterRegistrationModel)
        {
            var checkEmailUnique = _userRepository.CheckEmailUnique(shelterRegistrationModel.Credentials.Email);

            if (checkEmailUnique.IsError)
            {
                return(BadRequest(checkEmailUnique.Message));
            }

            var result = _shelterRepository.RegisterShelter(shelterRegistrationModel);

            if (result.IsError)
            {
                return(BadRequest(result.Message));
            }

            return(Ok(result.Data.Id));
        }