From 82c5138e03af1ffd6ea3cc55408564f264233076 Mon Sep 17 00:00:00 2001 From: Bryan Reiter Date: Thu, 7 Dec 2023 19:56:48 -0500 Subject: [PATCH] userRoutes JSDocs --- utils/db/userRouts.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/utils/db/userRouts.js b/utils/db/userRouts.js index fb8c141..8c9e459 100644 --- a/utils/db/userRouts.js +++ b/utils/db/userRouts.js @@ -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 @@ -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