Skip to content

Commit

Permalink
Updated: update the logic to enable/disable the save button on change(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed May 6, 2024
1 parent 0bbbeea commit 3451a6a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/AddStaffMemberModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ export default defineComponent({
return this.getParty(partyId) ? this.getParty(partyId).roleTypeId : ''
},
isRoleUpdated() {
return this.parties.some((party: any) => {
const selectedParty = this.selectedPartyValues.find((p: any) => p.partyId === party.partyId);
return selectedParty?.roleTypeId !== party.roleTypeId;
});
const lengthChanged = this.selectedPartyValues.length !== this.selectedParties.length;
return lengthChanged || this.selectedPartyValues.some((selectedParty: any) => {
const originalParty = this.selectedParties.find((party: any) => party.partyId === selectedParty.partyId);
return originalParty && selectedParty.roleTypeId !== originalParty.roleTypeId;
});
},
},
async mounted() {
Expand Down

0 comments on commit 3451a6a

Please sign in to comment.