Beispiel #1
0
        public async Task <ActionResult <RpDeleteCitizen> > DeleteCitizen([FromBody] RqDeleteCitizen rqDeleteCitizen)
        {
            try
            {
                var wasCitizenDeleted = await _peopleService.DeleteCitizen(rqDeleteCitizen.Guid.Value);

                if (!wasCitizenDeleted)
                {
                    return(Json(ResponseHelper.ReturnBadRequest("Citizen's guid not found")));
                }

                var rpDeleteCitizen = new RpDeleteCitizen();
                return(Json(rpDeleteCitizen));
            }
            catch (Exception exception)
            {
                LoggerStatic.Logger.Error("Exception: " + exception);
                return(Json(ResponseHelper.ReturnInternalServerError(exception.Message)));
            }
        }