Skip to content

Read News Data #18

@okaformark

Description

@okaformark

USER STORY

As a user, when I login to the site and navigate to the News tab, I want to see information about MY news.

ACCEPTANCE CRITERIA

WHEN i click on the news tab
THEN i should see my information about MY news displayed on the dashboard
AND i should see the news title, synopsis and the URL for the news

DEVELOPMENT

  • Create a news div idonindex.html`.
  • Create an newsData.js file in javascripts>helpers>data.
  • Import axios and apiKeys.
  • Get the databaseURL using const firebaseUrl = apiKeys.firebaseKeys.databaseURL;
  • Create a function called getNewsByUid that creates a new Promise. pass in uid.
  • Make an axios call to news and order by uid
  • Get the response using .then() and store in const newsResult
  • Using Object.Keys loop thru each key in the object and create an id.
  • newsResult[newsId].id = newsId;
  • push into an empty array const news and resolve
  • Export function
  • In news.js, import function and printToDom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions