public async Task <ActionResult> RemoveAsync(Guid discountId) { if (await _discountValidationService.DiscountExists(discountId) && await _favoritesValidationService.UserFavoritesNotExists(discountId)) { await _favoritesService.RemoveAsync(discountId); return(Ok()); } return(NotFound()); }
public async Task <ActionResult <DiscountExtendedDto> > GetAsync(Guid id) { if (!await _discountValidationService.DiscountExists(id)) { return(NotFound()); } var discount = await _discountService.GetByIdAsync(id); await _statisticsService.IncrementViewsAmountAsync(id); return(Ok(discount)); }