Closed thevinitgupta closed 1 year ago
@Gauravdarkslayer @abhinandanwadwa Kindly merge the PR after any of the two reviews completes!
@thevinitgupta @devarshishimpi I guess the same thing goes for the folder section as well.
It is a const
array. That is why I added a new array to return the required data.
@abhinandanwadwa shall I work on the folders route or wait for @devarshishimpi ?
@thevinitgupta Go ahead with folder routes
@abhinandanwadwa updated the folders routes.
Please use the delete key method I've mentioned earlier rather than creating a new array of objects.
@Gauravdarkslayer Is the required changes necessary or could we merge the PR?
They are not necessary but its required for performance & space related optimizations. @devarshishimpi
They are not necessary but its required for performance & space related optimizations. @devarshishimpi
Great, @thevinitgupta Could you complete the required change as well?
@Gauravdarkslayer can I use the select
method of the Schema prototype in this way :
const allNotes = await NoteSchema.find({ authorId: req.user.id, isDeleted: false }).select({_id : 1, title : 1, description : 1, createdAt : 1, secretKey : 1}).sort({ createdAt: -1 });
This way, we'll only need to delete the secretKey
.
@thevinitgupta Yes you can do this, but please make sure to be consistent throughout the application. Like if you are doing this for notes routes and do the same for folder routes as well.
I have added the select
query and used the delete
key method for the notes and folders routes.
Describe your changes
Removed the unwanted data being send to the frontend from the API Also, replaced with success message where needed.
Screenshots - If Any (Optional)
Issue ticket number and link - If Any
217
Checklist before requesting a review
[x] I have performed a self-review of my code.
[x] Followed the repository's Contributing Guidelines.
[x] I ran the app and tested it locally to verify that it works as expected.
[x] I have starred the repository.
Additional Information (Optional)