Skip to content

Use Fetch To Display And Update API. #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ASPhillips8
Copy link

@ASPhillips8 ASPhillips8 commented Jun 18, 2024

Used useEffect hook to display questions data from the API. Used QuestionForm Component to add new question and used POST to add to the API in state. Created Delete handler that updates the API in state. Created change answer event handler that updates the Answer for the question in state.
Screenshot 2024-06-17 at 10 20 42 PM

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

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

GREAT job!

Comment on lines +35 to +43
{page === "Form" ? (
<QuestionForm onAddQuestions={handleAddQuestion} />
) : (
<QuestionList
questions={questions}
onDeleteQuestion={handleDeleteQuestion}
onUpdateAnswer={handleAnswerChange}
/>
)}

Choose a reason for hiding this comment

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

Nice!

@@ -10,6 +10,7 @@ function QuestionForm(props) {
correctIndex: 0,
});


Choose a reason for hiding this comment

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

Suggested change

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.

2 participants