-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UXE-6007] fix: validate account address before adding payment method (…
- Loading branch information
1 parent
a699363
commit 306907f
Showing
6 changed files
with
106 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { getAccountInfoService, getUserInfoService } from '@/services/account-services' | ||
import { loadAccountJobRoleService } from '@/services/account-settings-services' | ||
import { loadContractServicePlan } from '@/services/contract-services' | ||
import { useAccountStore } from '@/stores/account' | ||
|
||
export const loadUserAndAccountInfo = async () => { | ||
const accountStore = useAccountStore() | ||
const [accountInfo, userInfo, accountJobRole] = await Promise.all([ | ||
getAccountInfoService(), | ||
getUserInfoService(), | ||
loadAccountJobRoleService() | ||
]) | ||
|
||
accountInfo.is_account_owner = userInfo.results.is_account_owner | ||
accountInfo.client_id = userInfo.results.client_id | ||
accountInfo.timezone = userInfo.results.timezone | ||
accountInfo.utc_offset = userInfo.results.utc_offset | ||
accountInfo.first_name = userInfo.results.first_name | ||
accountInfo.last_name = userInfo.results.last_name | ||
accountInfo.permissions = userInfo.results.permissions | ||
accountInfo.email = userInfo.results.email | ||
accountInfo.user_id = userInfo.results.id | ||
accountInfo.colorTheme = accountStore.theme | ||
accountInfo.jobRole = accountJobRole.jobRole | ||
accountInfo.isDeveloperSupportPlan = true | ||
|
||
if (accountInfo.client_id) { | ||
const { isDeveloperSupportPlan, yourServicePlan } = await loadContractServicePlan({ | ||
clientId: accountInfo.client_id | ||
}) | ||
accountInfo.isDeveloperSupportPlan = isDeveloperSupportPlan | ||
accountInfo.yourServicePlan = yourServicePlan | ||
} | ||
|
||
accountStore.setAccountData(accountInfo) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters