Check when the user doesn't have any location in database
This commit is contained in:
parent
db4403b75c
commit
ed97efaf61
@ -7,12 +7,12 @@
|
||||
using AspNetCore.Mvc;
|
||||
using Infrastructure;
|
||||
using System.Threading.Tasks;
|
||||
using Catalog.API.ViewModel;
|
||||
using Model;
|
||||
using EntityFrameworkCore;
|
||||
using Dto;
|
||||
using AspNetCore.Authorization;
|
||||
using Extensions.Options;
|
||||
using Microsoft.eShopOnContainers.Services.Marketing.API.ViewModel;
|
||||
|
||||
[Route("api/v1/[controller]")]
|
||||
[Authorize]
|
||||
@ -129,13 +129,10 @@
|
||||
{
|
||||
var marketingData = await _marketingDataRepository.GetAsync(userId.ToString());
|
||||
|
||||
if (marketingData is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var campaignDtoList = new List<CampaignDTO>();
|
||||
|
||||
if (marketingData != null)
|
||||
{
|
||||
//Get User Location Campaign
|
||||
foreach (var userLocation in marketingData.Locations)
|
||||
{
|
||||
@ -154,6 +151,7 @@
|
||||
campaignDtoList.AddRange(userCampaignDtoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var totalItems = campaignDtoList.Count();
|
||||
campaignDtoList = campaignDtoList
|
||||
|
@ -1,8 +1,7 @@
|
||||
namespace Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel
|
||||
namespace Microsoft.eShopOnContainers.Services.Marketing.API.ViewModel
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
public class PaginatedItemsViewModel<TEntity> where TEntity : class
|
||||
{
|
||||
public int PageIndex { get; private set; }
|
||||
|
@ -1,6 +1,3 @@
|
||||
using Microsoft.EntityFrameworkCore.Query.Internal;
|
||||
using WebMVC.ViewModels;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
||||
{
|
||||
using AspNetCore.Authorization;
|
||||
@ -10,6 +7,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using ViewModels.Pagination;
|
||||
using global::WebMVC.ViewModels;
|
||||
|
||||
[Authorize]
|
||||
public class CampaignsController : Controller
|
||||
|
Loading…
x
Reference in New Issue
Block a user