Exemple #1
0
        public async Task <IActionResult> DeleteOrganisationAsync(
            [FromRoute] string organisationId,
            [FromServices] IOrganisationService service)
        {
            if (string.IsNullOrWhiteSpace(organisationId))
            {
                return(BadRequest(new { reason = $"Invalid organisation id {organisationId}" }));
            }

            try
            {
                await service.DeleteByOrganisationNameAsync(organisationId);

                return(NoContent());
            }
            catch
            {
                return(StatusCode(statusCode: (int)HttpStatusCode.InternalServerError));
            }
        }