Skip to content

Conversation

@saffiullah200
Copy link
Collaborator

No description provided.

saffiullah200 and others added 30 commits August 5, 2024 20:55
filter and location issue resolved
maphathon flow updated
add mapathon issue fix
mapathin date validation fixed
update user profile resolvedd
forgot password link updated
resolve forgot password issues and activate user flow
replace remove function with delete one
resolve activation account issue
new fields added in user model lastLocation lastActivityTime and device
abdul-rehman90 and others added 28 commits June 10, 2025 19:07
allow repeating names for events
- Add lastLogin, inactivityEmailSent, and inactivityEmailSentAt fields to User model
- Update all authentication endpoints (sign-in, Google, Facebook, Apple) to track lastLogin
- Add archived account check for OAuth logins (returns 403 with userId)
- Create new /auth/reactivate-account endpoint for archived users
- Support password reset and profile update during reactivation
- Auto-login users after successful reactivation with JWT tokens
- Prepare backend for Salesforce integration for inactivity email workflows
Copilot AI review requested due to automatic review settings December 25, 2025 19:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a comprehensive library upgrade and feature expansion for the application. The changes modernize deprecated MongoDB methods, enhance authentication with Apple Sign-In support, introduce new accessibility review fields, and add donation/subscription functionality.

Key Changes:

  • Upgraded MongoDB methods from deprecated versions (.remove(), .count(), mongoose.Types.ObjectId()) to current standards (.deleteOne(), .countDocuments(), new mongoose.Types.ObjectId())
  • Added Apple Sign-In authentication alongside existing Google and Facebook authentication
  • Expanded venue accessibility review system with new fields (wheelchair parking, washrooms, multiple floors, etc.)
  • Implemented in-app purchase/subscription system with Apple and Google webhook support

Reviewed changes

Copilot reviewed 92 out of 117 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
src/scripts/db/*.js Updated deprecated Mongoose methods to modern equivalents
src/routes/auth/*.js Added Apple Sign-In, reactivation flow, and updated token expiration
src/routes/venues/*.js Added new venue details endpoint and expanded accessibility fields
src/routes/reviews/*.js Updated review system with new accessibility criteria
src/routes/donatins/*.js New donation/subscription system with payment verification
src/routes/events/*.js Added event filtering by status (upcoming, old, joined)
src/routes/users/*.js Enhanced user profile with additional demographic fields
src/models/*.js Added new schemas for surveys and donations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +67 to +76
return res.status(200).json({ general: "Joined" });

if (true || event.isOpen) {
req.user.events = [...req.user.events, event.id];
req.user.updatedAt = moment.utc().toDate();



return res.status(200).json({ general: "Joined" });
} else {
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreachable code detected. Lines 69-152 will never execute because of the return statement on line 67. The condition if (true || event.isOpen) on line 69 suggests this might be debugging code that was left in. Either remove the early return on line 67 or remove the unreachable code block.

Copilot uses AI. Check for mistakes.

let placesResponse;
try {
console.log(`https://maps.googleapis.com/maps/api/place/${searchType}/json${nearbyParams}&fields=photos,place_id`)
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console.log statement should be removed before merging to production. This appears to log API URLs which could expose sensitive query parameters.

Suggested change
console.log(`https://maps.googleapis.com/maps/api/place/${searchType}/json${nearbyParams}&fields=photos,place_id`)

Copilot uses AI. Check for mistakes.
let places = [];
const placesIds = [];
placesResponse.data.results.forEach((place) => {
console.log(place?.photos)
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console.log statement should be removed before merging to production.

Suggested change
console.log(place?.photos)

Copilot uses AI. Check for mistakes.
placeId,
});
let customReviews;
// console.log("venue", venue);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out debug code should be removed to keep the codebase clean.

Suggested change
// console.log("venue", venue);

Copilot uses AI. Check for mistakes.
placesIds.push(place.place_id);
});

// console.log("calling venues");
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out debug code should be removed to keep the codebase clean.

Suggested change
// console.log("calling venues");

Copilot uses AI. Check for mistakes.
token,
});
} catch (err) {
console.log(err)
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use console.error() instead of console.log() for error logging to properly categorize the log output.

Suggested change
console.log(err)
console.error(err);

Copilot uses AI. Check for mistakes.
refreshToken: refreshToken.key,
});
} catch (err) {
console.log(err);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use console.error() instead of console.log() for error logging to properly categorize the log output.

Suggested change
console.log(err);
console.error(err);

Copilot uses AI. Check for mistakes.
return res.status(400).json({ message: "verification failed" });
}
} catch (error) {
console.log(error);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use console.error() instead of console.log() for error logging to properly categorize the log output.

Copilot uses AI. Check for mistakes.
});
return res.status(200).json({ result });
} catch (error) {
console.log(error);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use console.error() instead of console.log() for error logging to properly categorize the log output.

Suggested change
console.log(error);
console.error(error);

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +15
// const { errors, isValid } = validateCreateEditReview(req.body);
// if (!isValid) return res.status(400).json(errors);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation is commented out, which means invalid review data can be submitted without any checks. This could lead to data integrity issues. Either uncomment the validation or remove it if it's intentionally disabled.

Suggested change
// const { errors, isValid } = validateCreateEditReview(req.body);
// if (!isValid) return res.status(400).json(errors);
const { errors, isValid } = validateCreateEditReview(req.body);
if (!isValid) return res.status(400).json(errors);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants