Skip to content

Commit

Permalink
Merge pull request #112 from Trumilnasit/main
Browse files Browse the repository at this point in the history
Needed to change some code related to features
  • Loading branch information
Anuj3553 authored Oct 15, 2024
2 parents f6732fc + f699f24 commit f1c8793
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion server/Models/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ const ProfileSchema = new Schema({
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'user',
required: true
},
image: {
image: String,
},
name: {
type: String,
required: true
},
email: {
type: String,
required: true,
unique: true,
},
address: {
type: String,
Expand All @@ -33,7 +37,8 @@ const ProfileSchema = new Schema({
},
password: {
type: String,
required: true,
},
});
}, { timestamps: true });

module.exports = mongoose.model('profile', ProfileSchema);
6 changes: 4 additions & 2 deletions server/routes/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ router.get('/fetchallglobalprojects',fetchallglobalprojects);
router.get('/fetchalluserprojects', fetchuser,fetchalluserprojects);

// ROUTE 3 : Add a New Project : POST: "/api/projects/addproject". Login required
router.post('/addproject', fetchuser,addproject)
router.post('/addproject', fetchuser, [
body('title', 'Title is required').not().isEmpty(),
], addproject);

// ROUTE 4 : Update an Existing Project : PUT: "/api/projects/updateproject". Login required
router.put('/updateproject/:id', fetchuser, updateproject);
Expand All @@ -27,4 +29,4 @@ router.post('/uploadProjectImage', fetchuser, uploadProjectImage);
// ROUTE 7 : Get All User Project : GET: "/api/projects/getProjectImage". Login required
router.get('/getProjectImage', fetchuser, getProjectImage);

module.exports = router
module.exports = router

0 comments on commit f1c8793

Please sign in to comment.