Skip to content

Commit

Permalink
fix: Set current organization. (adempiere#989)
Browse files Browse the repository at this point in the history
* fix: Set current organization.

* update git sub-modules
  • Loading branch information
EdwinBetanc0urt authored May 2, 2023
1 parent fe31149 commit af86078
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ const actions = {
})
}
if (isEmptyValue(role)) {
role = rolesList[0]
role = rolesList.at(0)
}

if (!isEmptyValue(role)) {
Expand Down Expand Up @@ -369,7 +369,10 @@ const actions = {

return requestOrganizationsList({ roleUuid })
.then(response => {
const organization = response.organizationsList.find(a => a.id === getters.getCurrentOrgId)
let organization = response.organizationsList.find(a => a.id === getters.getCurrentOrgId)
if (isEmptyValue(organization)) {
organization = response.organizationsList.at(0)
}
commit('SET_ORGANIZATIONS_LIST', response.organizationsList)
const { uuid, id } = organization
setCurrentOrganization(uuid)
Expand Down

0 comments on commit af86078

Please sign in to comment.