Skip to content

Conversation

@herrone
Copy link
Contributor

@herrone herrone commented Oct 30, 2023

Added tests for Jira #69

Comment on lines +63 to +90
txe_teamMemberFirstName.Text = "";
txe_teamMemberLastName.Text = "";
txe_teamMemberEmail.Text = "";
}


/*!
* Detect delete button being clicked
* @param sender (Object) the sender object created by the event
* @param e (EventArgs) the arguments passed into the event
*/
private async void DeleteButton_Clicked(object sender, EventArgs e)
{
if (ltv_teamMembers.SelectedItem == null)
{
await DisplayAlert("No TeamMember Selected", "Select the teamMember you want to delete from the list", "OK");
return;
}

TeamMember selectedTeamMember = (TeamMember)ltv_teamMembers.SelectedItem;

await teamMemberService.DeleteTeamMember(selectedTeamMember);
teamMembers.Remove(selectedTeamMember);

// Clear input fields
txe_teamMemberFirstName.Text = "";
txe_teamMemberLastName.Text = "";
txe_teamMemberEmail.Text = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

this violates dry

Copy link
Contributor

Choose a reason for hiding this comment

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

and it also violates SRP because it should be in a different method

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