Skip to content
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

Edit mentor team async await #236

Merged

Conversation

jimbandrews
Copy link
Contributor

@jimbandrews jimbandrews commented Oct 23, 2023

Pull Request Template

1. Targeted Issue

(The first step to a good solution is knowing the problem. Please link the issue here.)

Issue #... or
Ticket #...

https://trello.com/c/v1vEtFrr/140-add-team-number-to-the-mentors-profile

2. Overview of Solution

(You've put in the hard work, now's your chance to tell us about it. What's your solution in a nutshell?)

ProfileMentor.js now has a teamNumber state, which is displayed above the ProfileBasicInfo.

In EditProfile.js, the mentorinfo axios call now handles the teamNumber data, and the teamNumber form field is no longer tied to the isMentee state. Also, the useEffect hook and editProfile function now use async-await to handle promises.

3. Tools Used

(Share the tools, libraries, or techniques you've used in your solution.)
Promises in EditProfile.js now use async-await. The editProfile function bundles the 2 patch requests into a single Promise using Promise.all(), allowing them to be run concurrently.

4. Testing Strategy

(No code is complete without tests. Outline what you've tested and how.)
Testing hasn't been implemented on the frontend yet (plus I don't really know how to test React code). Locally run the front and back ends, and edit a part of a mentor's profile.

5. Future Implications

(Let's anticipate potential effects of your changes. Are there any potential issues down the line?)
If any future contributor is not used to using async await, this will hopefully serve as a nice example.

6. Screenshots

(A picture is worth a thousand words. Include screenshots of your changes if relevant.)

7. Code Reviewers

(Who else is in the loop? Mention your team or other contributors here.)
@emilyflo @GitLukeW @nzeager


Before you go...

  • [x ] I have linked the relevant issue
  • [x ] I have provided an overview of my solution
  • [x ] I have shared the tools I've used
  • [x ] I have outlined my testing strategy
  • [x ] I have considered future implications of my changes
  • I have included relevant screenshots
  • I have kept my team in the loop

Big high-fives for your incredible pull request! We're thrilled to have you as a contributor! Our team will dig into your proposed changes and give you some feedback or merge them if they're good to go. Your contributions mean the world to us!

@netlify
Copy link

netlify bot commented Oct 23, 2023

‼️ Deploy request for staging-momentors rejected.

Name Link
🔨 Latest commit 4ef496c

Copy link
Contributor

@GitLukeW GitLukeW left a comment

Choose a reason for hiding this comment

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

Looks good!. Thanks for getting this ticket closed out!

@GitLukeW GitLukeW merged commit a7a5e83 into TeamProductionSystem:staging Oct 25, 2023
Copy link

@amgillenwater amgillenwater left a comment

Choose a reason for hiding this comment

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

LGTM--just a small note for the future. I might look at the backlog and see if we have a place for tech debt to add it to (I'm new to Trello)

onChange={(e) => setTeamNumber(e.target.value)}
></TextField>
</Stack>

Choose a reason for hiding this comment

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

I have limited knowledge of this app (first time actually looking at this code) but this looks good to me. I do want to note that this component is getting lorrrge and is probably a good candidate for a refactor in the future--we could definitely abstract some of those API calls, especially if they're used in other components.

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.

3 participants