From 067c676793b84efa6d7a4178c9080ca93fc10d13 Mon Sep 17 00:00:00 2001 From: anela Date: Fri, 3 Jun 2022 15:34:35 -0700 Subject: [PATCH] updated POST request to API for insertStoryIntoFavorites --- js/models.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/models.js b/js/models.js index 87f74a0..d7da19c 100644 --- a/js/models.js +++ b/js/models.js @@ -185,19 +185,19 @@ class User { async insertStoryIntoFavorites(story) { const response = await axios({ - url: `${BASE_URL}/${username}/favorites/${story.storyId}`, + url: `${BASE_URL}/users/${currentUser.username}/favorites/${story.storyId}`, method: "POST", - data: { token: `${username.loginToken}` } + data: { token: `${currentUser.loginToken}` } }); console.log("our response from the api post ...", response); - currentUser.favorites.push(story); + // currentUser.favorites.push(story); console.log("what's inside my favorite list... ", currentUser.favorites); } - /** second mehtod */ + /** second method */