Skip to content

Maryyy_ux_project-happy-thoughts-api#513

Open
Maryyy-ux wants to merge 2 commits intoTechnigo:masterfrom
Maryyy-ux:master
Open

Maryyy_ux_project-happy-thoughts-api#513
Maryyy-ux wants to merge 2 commits intoTechnigo:masterfrom
Maryyy-ux:master

Conversation

@Maryyy-ux
Copy link

@Maryyy-ux
Copy link
Author

@HIPPIEKICK HIPPIEKICK self-assigned this Jan 9, 2025
Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a comment

Choose a reason for hiding this comment

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

Changes requested

  • Use mongoose methods when you can
  • Remove .env file
  • Update frontend with the link to your own deployed API

otherwise - good job!

Copy link
Contributor

Choose a reason for hiding this comment

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

Now your method of uploading files is becoming a problem... Your env file should never be uploaded to GitHub, that's why it's included in the git ignore file. This wouldn't happen if you follow our instructions of committing files the "developer way"

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice that you broke this out 👍

Comment on lines +63 to +69
const thought = await Thought.findById(thoughtId);
if (!thought) {
return res.status(404).json({ error: 'Thought not found' });
}
thought.hearts += 1; // Hearts increases//Incrementar el número de corazones
await thought.save();
res.json(thought);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use findByIdAndUpdate for updating hearts directly instead of fetching, modifying, and saving? 🤔

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.

2 participants