From 0ff9b8b1ea43f6912c1f2dca524d10949b274d57 Mon Sep 17 00:00:00 2001 From: anela Date: Thu, 2 Jun 2022 17:35:37 -0700 Subject: [PATCH] start code for addStory --- js/models.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/models.js b/js/models.js index 5a03c61..14e0ec9 100644 --- a/js/models.js +++ b/js/models.js @@ -73,7 +73,7 @@ class StoryList { * Returns the new Story instance */ - async addStory(/*user, newStory*/) { + async addStory(user, newStory) { // UNIMPLEMENTED: complete this function! /* user = ("theCat"); @@ -85,8 +85,12 @@ class StoryList { let newStory = await storyList.addStory(currentUser, {title: "Test", author: "Me", url: "http://meow.com"}); */ - - + const response = await axios({ + url: `${BASE_URL}/stories`, + method: "POST", + params: {"token": user.loginToken, "story": } + }) + } }