Skip to content

Add refactoring tips#14

Open
marina-workco wants to merge 1 commit into
mainfrom
comments
Open

Add refactoring tips#14
marina-workco wants to merge 1 commit into
mainfrom
comments

Conversation

@marina-workco
Copy link
Copy Markdown
Collaborator

No description provided.

@marina-workco marina-workco self-assigned this Dec 10, 2022
@marina-workco marina-workco requested review from KracunjelM and luka196 and removed request for luka196 December 10, 2022 12:10
Comment thread src/App.js
@@ -40,14 +40,21 @@ function App() {
<div className="app">
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets try to make this part of code DRY

 useEffect(() => {
    fetch("http://localhost:3333/664/api/candidates")
      .then(res => res.json())
      .then(res => setCandidates(res))
      fetch("http://localhost:3333/664/api/companies")
      .then(res => res.json())
      .then(res => setCompanies(res))
      fetch("http://localhost:3333/664/api/reports")
      .then(res => res.json())
      .then(res => setReports(res))
      fetch("http://localhost:3333/444/api/users")
      .then(res => res.json())
      .then(res => setUsers(res))
  }, [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant