Skip to content

Conversation

@Vriti62
Copy link
Contributor

@Vriti62 Vriti62 commented Aug 25, 2025

Closes: #1194
Linked to parent issue: #1180

Project Published URL 🔗
Backend-only change. Tested locally using Postman

Description 📃
Implemented backend logic to allow users to save a project into their saved collections.
Added auto-creation of a collection if it does not already exist.
Prevented duplicate project entries inside the same collection.
Used req.user from authentication middleware to ensure only logged-in users can save projects.
Response returns appropriate messages (new collection created, project saved, or duplicate prevention).
Added comments for readability and understanding

Screenshots 📷
image
fig1: automatically adding project to default collection and saving project
image
fig2: duplicate projects check in same collection
image
fig3: added to an existing collection

Type of change ☑️
What sort of change have you made:

[☑️ ] New feature
[☑️ ] Database update
Note to reviewers 📄
This is a backend-only feature and does not require frontend updates.

Kindly review the collection auto-creation logic and suggest if collection schema needs adjustment for multiple project references instead of separate documents.
Always open for feedbacks!!

@vercel
Copy link

vercel bot commented Aug 25, 2025

@Vriti62 is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Aug 25, 2025

Deploy Preview for code-a2z canceled.

Name Link
🔨 Latest commit 09abb17
🔍 Latest deploy log https://app.netlify.com/projects/code-a2z/deploys/68acb9b508faa800082ddb47

@github-actions
Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

Copy link
Member

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

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

Looks Good 👍

@Avdhesh-Varshney Avdhesh-Varshney merged commit db326dc into Code-A2Z:main Aug 26, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: Save a New Project to an Existing Collection (or Auto create the collection)

2 participants