From 813ead675a058435183639574bd72fdf3a31f621 Mon Sep 17 00:00:00 2001 From: anela Date: Thu, 2 Jun 2022 20:30:09 -0700 Subject: [PATCH] addStory returns instance of Story --- js/models.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/js/models.js b/js/models.js index b798926..3c0c343 100644 --- a/js/models.js +++ b/js/models.js @@ -96,18 +96,19 @@ class StoryList { ); console.log("the response is : ", response); - this.storyId = storyId; - this.title = title; - this.author = author; - this.url = url; - this.username = username; - this.createdAt = createdAt; - - let returnObj = { - ${response.data.} - }; - - return response; + // this.storyId = storyId; + // this.title = title; + // this.author = author; + // this.url = url; + // this.username = username; + // this.createdAt = createdAt; + + // let returnObj = { + // ${response.data.} + // }; + + return new Story(response.data.story); + } }