diff --git a/src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs b/src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs index cd68313fe..c8e605520 100644 --- a/src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs +++ b/src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs @@ -29,7 +29,7 @@ public async Task GetUserLocation(string userId) { - return await _locationsRepository.GetUserLocationAsync(id); + return await _locationsRepository.GetUserLocationAsync(userId); } public async Task> GetAllLocation() @@ -52,7 +52,7 @@ var userLocation = await _locationsRepository.GetUserLocationAsync(userId); userLocation = userLocation ?? new UserLocation(); userLocation.UserId = userId; - userLocation.LocationId = currentUserAreaLocationList[0].Id; + userLocation.LocationId = currentUserAreaLocationList[0].LocationId; userLocation.UpdateDate = DateTime.UtcNow; await _locationsRepository.UpdateUserLocationAsync(userLocation); diff --git a/src/Services/Location/Locations.API/Model/Locations.cs b/src/Services/Location/Locations.API/Model/Locations.cs index 0944008a7..df521b9b7 100644 --- a/src/Services/Location/Locations.API/Model/Locations.cs +++ b/src/Services/Location/Locations.API/Model/Locations.cs @@ -7,8 +7,10 @@ public class Locations { + [BsonId] [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } + public int LocationId { get; set; } public string Code { get; set; } [BsonRepresentation(BsonType.ObjectId)] public string Parent_Id { get; set; }