Skip to content

Commit 68dbc92

Browse files
committed
Add LocationId field to UserLocation
1 parent 486ba18 commit 68dbc92

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Services/Location/Locations.API/Infrastructure/Services/LocationsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task<Locations> GetLocation(string locationId)
2929

3030
public async Task<UserLocation> GetUserLocation(string userId)
3131
{
32-
return await _locationsRepository.GetUserLocationAsync(id);
32+
return await _locationsRepository.GetUserLocationAsync(userId);
3333
}
3434

3535
public async Task<List<Locations>> GetAllLocation()
@@ -52,7 +52,7 @@ public async Task<bool> AddOrUpdateUserLocation(string userId, LocationRequest c
5252
var userLocation = await _locationsRepository.GetUserLocationAsync(userId);
5353
userLocation = userLocation ?? new UserLocation();
5454
userLocation.UserId = userId;
55-
userLocation.LocationId = currentUserAreaLocationList[0].Id;
55+
userLocation.LocationId = currentUserAreaLocationList[0].LocationId;
5656
userLocation.UpdateDate = DateTime.UtcNow;
5757
await _locationsRepository.UpdateUserLocationAsync(userLocation);
5858

src/Services/Location/Locations.API/Model/Locations.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
public class Locations
99
{
10+
[BsonId]
1011
[BsonRepresentation(BsonType.ObjectId)]
1112
public string Id { get; set; }
13+
public int LocationId { get; set; }
1214
public string Code { get; set; }
1315
[BsonRepresentation(BsonType.ObjectId)]
1416
public string Parent_Id { get; set; }

0 commit comments

Comments
 (0)