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

Fixed: payload is fetched when user toggles from true to false #255

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
25 changes: 19 additions & 6 deletions src/views/UserDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
<ion-list>
<ion-item :disabled="!hasPermission(Actions.APP_UPDT_PICKER_CONFG)">
<ion-toggle @click.prevent="updatePickerRoleStatus($event)" :checked="selectedUser.isWarehousePicker === true">
{{ translate("Show as picker") }}
{{ translate("Show as picker") }}
</ion-toggle>
</ion-item>
<ion-item lines="none" button detail :disabled="!hasPermission(Actions.APP_UPDT_FULFILLMENT_FACILITY) || selectedUser.securityGroup.groupId === 'INTEGRATION'" @click="selectFacility()">
Expand Down Expand Up @@ -998,11 +998,24 @@ export default defineComponent({
"roleTypeIdTo": "WAREHOUSE_PICKER"
})
} else {
resp = await UserService.updatePartyRelationship({
...this.selectedUser?.pickerRelationship,
"thruDate": DateTime.now().toMillis()
})
}
const response = await UserService.fetchPartyRelationship({
inputFields: {
partyIdTo: this.selectedUser.partyId,
roleTypeIdTo: 'WAREHOUSE_PICKER',
roleTypeIdTo_op: 'equals'
},
filterByDate: 'Y',
viewSize: 1,
entityName: 'PartyRelationship',
fieldList: ['partyIdTo', 'roleTypeIdTo', "partyIdFrom", "roleTypeIdFrom", "fromDate"]
})
const fetchedRelationShip = response.data.docs[0]

resp = await UserService.updatePartyRelationship({
...fetchedRelationShip,
"thruDate": DateTime.now().toMillis()
})
}
if (!hasError(resp)) {
showToast(translate('User picker role updated successfully.'))
// updating toggle state on success
Expand Down
Loading