Bug: Fix account_id in URLs (#894)
* Bug: Fix account_id in URLs * Fix accountMixin specs
This commit is contained in:
@@ -94,12 +94,12 @@
|
||||
import Vue from 'vue';
|
||||
import { required } from 'vuelidate/lib/validators';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { accountIdFromPathname } from 'dashboard/helper/URLHelper';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import configMixin from 'shared/mixins/configMixin';
|
||||
import accountMixin from '../../../../mixins/account';
|
||||
|
||||
export default {
|
||||
mixins: [alertMixin, configMixin],
|
||||
mixins: [accountMixin, alertMixin, configMixin],
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
@@ -140,10 +140,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async initializeAccount() {
|
||||
const { pathname } = window.location;
|
||||
const accountId = accountIdFromPathname(pathname);
|
||||
|
||||
if (accountId) {
|
||||
try {
|
||||
await this.$store.dispatch('accounts/get');
|
||||
const {
|
||||
name,
|
||||
@@ -153,7 +150,7 @@ export default {
|
||||
support_email,
|
||||
domain_emails_enabled,
|
||||
features,
|
||||
} = this.getAccount(accountId);
|
||||
} = this.getAccount(this.accountId);
|
||||
|
||||
Vue.config.lang = locale;
|
||||
this.name = name;
|
||||
@@ -163,6 +160,8 @@ export default {
|
||||
this.supportEmail = support_email;
|
||||
this.domainEmailsEnabled = domain_emails_enabled;
|
||||
this.features = features;
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -82,13 +82,14 @@ import ChannelApi from '../../../../../api/channels';
|
||||
import PageHeader from '../../SettingsSubPageHeader';
|
||||
import router from '../../../../index';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import accountMixin from '../../../../../mixins/account';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LoadingState,
|
||||
PageHeader,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
mixins: [globalConfigMixin, accountMixin],
|
||||
data() {
|
||||
return {
|
||||
isCreating: false,
|
||||
@@ -126,9 +127,6 @@ export default {
|
||||
currentUser: 'getCurrentUser',
|
||||
globalConfig: 'globalConfig/get',
|
||||
}),
|
||||
accountId() {
|
||||
return this.currentUser.account_id;
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user