Add nullable int beaconId + ensure ressource has no duplicate
This commit is contained in:
parent
042949ec60
commit
33f782346b
@ -25,6 +25,6 @@ namespace Manager.Interfaces.DTO
|
||||
public string longitude { get; set; } // MyVisit - Use to launch automatic content when current location is near
|
||||
public int? meterZoneGPS { get; set; } // MyVisit - Nbr of meters of the zone to launch content
|
||||
public bool isBeacon { get; set; } // MyVisit - True if section use beacon, false otherwise
|
||||
public int beaconId { get; set; } // MyVisit - Beacon' identifier
|
||||
public int? beaconId { get; set; } // MyVisit - Beacon' identifier
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ namespace Manager.Interfaces.Models
|
||||
public bool IsBeacon { get; set; }
|
||||
|
||||
[BsonElement("BeaconId")]
|
||||
public int BeaconId { get; set; }
|
||||
public int? BeaconId { get; set; }
|
||||
|
||||
[BsonElement("Latitude")]
|
||||
public string Latitude { get; set; }
|
||||
|
||||
@ -382,7 +382,9 @@ namespace ManagerService.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var audio in articleDTO.audioIds.Where(a => a.language == language))
|
||||
// If not a language is used for export in manager, if one is the myvisit app
|
||||
var audios = language != null ? articleDTO.audioIds.Where(a => a.language == language) : articleDTO.audioIds;
|
||||
foreach (var audio in audios)
|
||||
{
|
||||
if (audio.value != null)
|
||||
{
|
||||
@ -636,7 +638,7 @@ namespace ManagerService.Controllers
|
||||
Resource resource = _resourceService.GetById(resourceId);
|
||||
ResourceData resourceData = _resourceDataService.GetByResourceId(resourceId);
|
||||
|
||||
if (resource != null && resourceData != null) {
|
||||
if (resource != null && resourceData != null && !resourceDTOs.Any(r => r.id == resource.Id)) {
|
||||
resourceDTOs.Add(resource.ToDTO(resourceData.Data));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user