sending the distance in the getbyid of activity
This commit is contained in:
@@ -2038,28 +2038,22 @@ export class UserService {
|
||||
const userLat = userLocation?.locationLat ?? null;
|
||||
const userLng = userLocation?.locationLong ?? null;
|
||||
|
||||
console.log(userLat, "UserLat")
|
||||
console.log(userLng, "UserLong")
|
||||
console.log(activity.checkInLat, "activityCheckIn")
|
||||
console.log(activity.checkInLong, "activityCheckLong")
|
||||
let distance = 0;
|
||||
|
||||
// let distance = 0;
|
||||
if (
|
||||
userLat &&
|
||||
userLng &&
|
||||
activity?.checkInLat &&
|
||||
activity?.checkInLong
|
||||
) {
|
||||
distance = calculateDistance(
|
||||
userLat,
|
||||
userLng,
|
||||
activity.checkInLat,
|
||||
activity.checkInLong
|
||||
)
|
||||
};
|
||||
|
||||
// if (
|
||||
// userLat &&
|
||||
// userLng &&
|
||||
// activity?.checkInLat &&
|
||||
// activity?.checkInLong
|
||||
// ) {
|
||||
// distance = calculateDistance(
|
||||
// userLat,
|
||||
// userLng,
|
||||
// activity.checkInLat,
|
||||
// activity.checkInLong
|
||||
// )
|
||||
// };
|
||||
|
||||
// console.log(distance, "Distance is this")
|
||||
|
||||
// ================= PRESIGNED URL SECTION =================
|
||||
|
||||
@@ -2233,13 +2227,7 @@ export class UserService {
|
||||
cheapestPrice,
|
||||
totalCapacity,
|
||||
rating: 0, // ⭐ Placeholder, implement rating logic as needed
|
||||
// distance: calculateDistance(
|
||||
// userLat,
|
||||
// userLng,
|
||||
// activity?.checkInLat ?? null,
|
||||
// activity?.checkInLong ?? null
|
||||
// ),
|
||||
distance: 0,
|
||||
distance: distance || 0,
|
||||
interestedUserImages
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user