Пример #1
0
        public async Task <IActionResult> Delete(int?id, bool notUsed)
        {
            if (!id.HasValue)
            {
                return(NotFound());
            }

            await _placesService.DeletePlace(id.Value);

            return(RedirectToAction("Index"));
        }
Пример #2
0
        public async Task <IActionResult> DeleteEstablishment(string establishmentId)
        {
            var user = GetUserId();
            var res  = await _placesService.DeletePlace(establishmentId, user);

            if (res)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Пример #3
0
        public IActionResult Delete(int id)
        {
            _logger.Information($"Deleting place with id: {id}");
            var request = new PlaceIdRequest()
            {
                Id = id
            };

            var response = _placeServices.DeletePlace(request);

            if (!response.Result)
            {
                return(BadRequest(response.Errors));
            }

            if (response.Errors.Count > 0)
            {
                return(NotFound(response.Errors));
            }

            return(Ok());
        }
Пример #4
0
        public async Task <IActionResult> DeletePlace(int id)
        {
            var place = await _placesService.DeletePlace(id);

            return(Ok(place));
        }