You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a Profile Page is good option. As it is very usefully to know user itself details and can know total how many number of post user has made .
Use Case
1 ) Able to know user basic details like username and email
2 ) Able to change/Update password
3 ) Able to look over how many number of Blog post user has done
Additionally able to
4 ) Perform CRUD operation over the blog user has post if possible
This will uplift your website.
Proposed Solution
1 ) As soon as user login/sign-in the website then added the user details to Local Storage of Browser.
2 ) Take the User details from Local Storage and show it as Profile Page
3 ) Create 1 API which take all information of User and check if any information has been change by user then update the user details in DB .
4 ) Create another API which take user email or username and find the user Blog post details form DB and fetch it . Then Show the details of user ' s blog post.
// Check if password is provided and update it
if (formData.password) {
const salt = await bcrypt.genSalt(10);
formData.password = await bcrypt.hash(
formData.password,
salt
);
}
// Update the user profile with the new data
const updatedProfile =
await Model.findByIdAndUpdate(
userId,
formData,
{ new: true }
);
res.json({
updatedProfile,
update: true,
});
} catch (error) {
console.log(error);
next(error);
}
})
);
5 ) Additional can create 2 API . 1st to Delete the blog post by user . 2nd Updating the blog post.
Additional Information
Hope you find issue to be good to solve
Attachments
The text was updated successfully, but these errors were encountered:
My name is Shivam Kanchole, and I am a fourth-year student at IIT Roorkee. I find this issue both interesting and challenging. Additionally, I have worked on similar projects in the past. Could you please assign this issue to me?
@Adityajparmar37 if you are still interested in working on this project, let me know via the project's discord, I might have some better issues of level 2 and 3 that you could work on !!
@krishnaacharyaa sounds great but the thing is currently my exam are going on hence i will not to able to give that much time.
And i does not want someone be waiting so sorry
Description
Having a Profile Page is good option. As it is very usefully to know user itself details and can know total how many number of post user has made .
Use Case
1 ) Able to know user basic details like username and email
2 ) Able to change/Update password
3 ) Able to look over how many number of Blog post user has done
Additionally able to
4 ) Perform CRUD operation over the blog user has post if possible
This will uplift your website.
Proposed Solution
1 ) As soon as user login/sign-in the website then added the user details to Local Storage of Browser.
2 ) Take the User details from Local Storage and show it as Profile Page
3 ) Create 1 API which take all information of User and check if any information has been change by user then update the user details in DB .
4 ) Create another API which take user email or username and find the user Blog post details form DB and fetch it . Then Show the details of user ' s blog post.
Eg. router.put(
"/update",
authMid,
handler(async (req, res, next) => {
try {
const formData = req.body;
const userId = req.user.id;
const existingProfile =
await Model.findById(userId);
})
);
5 ) Additional can create 2 API . 1st to Delete the blog post by user . 2nd Updating the blog post.
Additional Information
Hope you find issue to be good to solve
Attachments
The text was updated successfully, but these errors were encountered: