Skip to content

Commit

Permalink
Merge pull request #200 from R-Sourabh/#196-block-login
Browse files Browse the repository at this point in the history
Fixed: Inconsistencies with Block Login Toggle functionality(#196)
  • Loading branch information
ymaheshwari1 authored Apr 29, 2024
2 parents 540ba26 + 6dc83e2 commit ee85e87
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/views/UserDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<ion-label slot="end">{{ selectedUser.userLoginId }}</ion-label>
</ion-item>
<ion-item :disabled="!hasPermission(Actions.APP_UPDT_BLOCK_LOGIN)" >
<ion-toggle @click.prevent="updateUserLoginStatus($event)" :checked="selectedUser.enabled === 'N'">
<ion-toggle @click.prevent="updateUserLoginStatus($event)" :checked="selectedUser.enabled == 'N'">
{{ translate("Block login") }}
</ion-toggle>
</ion-item>
Expand Down Expand Up @@ -518,7 +518,7 @@ export default defineComponent({
imageUrl: "",
isUserFetched: false,
showPassword: false,
shopifyShopsForProductStore: [] as any
shopifyShopsForProductStore: [] as any,
}
},

Expand Down Expand Up @@ -774,6 +774,7 @@ export default defineComponent({
showToast(translate('User login status updated successfully.'))
// updating toggle state on success
event.target.checked = isChecked
this.selectedUser.enabled = isChecked ? 'N' : 'Y'
} else {
throw resp.data
}
Expand Down Expand Up @@ -1085,6 +1086,14 @@ export default defineComponent({
emitter.emit('presentLoader')

try {
if (isChecked) {
await UserService.updateUserLoginStatus({
enabled: 'N',
partyId: this.partyId,
userLoginId: this.selectedUser.userLoginId
});
this.selectedUser.enabled = 'N';
}
if(this.selectedUser.partyTypeId === 'PARTY_GROUP') {
resp = await UserService.updatePartyGroup(payload)
} else {
Expand Down

0 comments on commit ee85e87

Please sign in to comment.