Browse Source

Add LocationId field to UserLocation

pull/223/head
Christian Arenas 7 years ago
parent
commit
251cfa0845
2 changed files with 4 additions and 2 deletions
  1. +2
    -2
      src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs
  2. +2
    -0
      src/Services/Location/Locations.API/Model/Locations.cs

+ 2
- 2
src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs View File

@ -29,7 +29,7 @@
public async Task<UserLocation> GetUserLocation(string userId) public async Task<UserLocation> GetUserLocation(string userId)
{ {
return await _locationsRepository.GetUserLocationAsync(id);
return await _locationsRepository.GetUserLocationAsync(userId);
} }
public async Task<List<Locations>> GetAllLocation() public async Task<List<Locations>> GetAllLocation()
@ -52,7 +52,7 @@
var userLocation = await _locationsRepository.GetUserLocationAsync(userId); var userLocation = await _locationsRepository.GetUserLocationAsync(userId);
userLocation = userLocation ?? new UserLocation(); userLocation = userLocation ?? new UserLocation();
userLocation.UserId = userId; userLocation.UserId = userId;
userLocation.LocationId = currentUserAreaLocationList[0].Id;
userLocation.LocationId = currentUserAreaLocationList[0].LocationId;
userLocation.UpdateDate = DateTime.UtcNow; userLocation.UpdateDate = DateTime.UtcNow;
await _locationsRepository.UpdateUserLocationAsync(userLocation); await _locationsRepository.UpdateUserLocationAsync(userLocation);


+ 2
- 0
src/Services/Location/Locations.API/Model/Locations.cs View File

@ -7,8 +7,10 @@
public class Locations public class Locations
{ {
[BsonId]
[BsonRepresentation(BsonType.ObjectId)] [BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; } public string Id { get; set; }
public int LocationId { get; set; }
public string Code { get; set; } public string Code { get; set; }
[BsonRepresentation(BsonType.ObjectId)] [BsonRepresentation(BsonType.ObjectId)]
public string Parent_Id { get; set; } public string Parent_Id { get; set; }


Loading…
Cancel
Save