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

Testing #380

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Certificates/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Certificates extends React.Component {
let sortedTeams = {};
collegesService.getParticipants(user.college).then(participants => {
for (let team of teams) {
let members = participants.filter(member => team.members.includes(member.id));
let members = participants.filter(member => team.members.includes(member.id) && member.certificateEligible);
team.members = members;
}

Expand Down
24 changes: 23 additions & 1 deletion src/components/CollegeTeams/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default class EditMember extends React.Component {

componentWillMount() {
participantsService.get(this.props.member).then(participant => {

this.setState({ participant: participant || {} })
});

Expand Down Expand Up @@ -90,6 +89,29 @@ export default class EditMember extends React.Component {
/>
</div>

<div className="flex my-2">
<div>Eligible for certification</div>
<input
onChange={(e)=>{
const val = e.target.checked;
this.setState((prev)=>{
return {
participant: {
...prev.participant,
certificateEligible: val,
}
}
});
}}
autoComplete="off"
name="certificateEligible"
type="checkbox"
checked={this.state.participant.certificateEligible}
placeholder="Eligible for certificate"
css={{ width: 50 }}
/>
</div>

<div>
<Button
onClick={this.handleClick}
Expand Down
1 change: 1 addition & 0 deletions src/services/participants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const get = async (participantID) => {
};

const update = async (participantID, participant) => {
console.log(participant)
let response = await request("/participants/" + participantID, "PATCH", participant);

if (response && response.status === 200) {
Expand Down
Loading