Skip to content

fix: findByIdAndUpdate; callback funtion return object,object#19

Open
codedfinger wants to merge 1 commit into
MosesEsan:masterfrom
codedfinger:hotfix
Open

fix: findByIdAndUpdate; callback funtion return object,object#19
codedfinger wants to merge 1 commit into
MosesEsan:masterfrom
codedfinger:hotfix

Conversation

@codedfinger

Copy link
Copy Markdown

No description provided.

@codedfinger

Copy link
Copy Markdown
Author

hotfix: On update of profile image, an error is returned from the mongoose function findByIdAndUpdate.

A detailed explanation can be found here: https://stackoverflow.com/questions/66370059/findoneandupdate-callback-must-be-a-function-got-object-object-nodejs-mon

@codedfinger

Copy link
Copy Markdown
Author

Also a loop after updating profile image as !req.file checks if there is no file. But using result.url with return the accurate response by checking if image URL was updates on the db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant