Skip to content

Commit

Permalink
userRoutes JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanreiter committed Dec 8, 2023
1 parent 2145b90 commit 82c5138
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions utils/db/userRouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ router.get('/salt/:email', async (req, res) => {
}
});

/**
* Route serving user likes based on email.
* @param {string} req.params.email - The email of the user.
* @returns {Object} 200 - An array of user likes
* @returns {Error} 404 - User not found
* @returns {Error} 500 - Server error
*/
router.get('/likes/:email', async (req, res) => {
try{
// Get the user with the specified email
Expand Down Expand Up @@ -250,6 +257,14 @@ router.put('/id/:id', async (req, res) => {
}
});

/**
* Route serving user likes update based on user ID and pet ID.
* @param {string} req.params.userID - The ID of the user.
* @param {string} req.params.petID - The ID of the pet.
* @returns {Object} 200 - An object containing the number of rows affected
* @returns {Error} 404 - User or pet not found
* @returns {Error} 500 - Server error
*/
router.put('/liked/:userID/:petID', async (req, res) => {
try {
// Update the user with the specified ID
Expand Down

0 comments on commit 82c5138

Please sign in to comment.