feat: Changes account creation to support multiple steps (#8859)
* feat: Changes account creation to support multiple steps * Adds API changes and new routes * Fixes type
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
/* global axios */
|
||||
|
||||
import ApiClient from './ApiClient';
|
||||
|
||||
class Agents extends ApiClient {
|
||||
constructor() {
|
||||
super('agents', { accountScoped: true });
|
||||
}
|
||||
|
||||
bulkInvite({ emails }) {
|
||||
return axios.post(`${this.url}/bulk_create`, {
|
||||
emails,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default new Agents();
|
||||
|
||||
@@ -8,7 +8,10 @@ import helpcenterRoutes from './helpcenter/helpcenter.routes';
|
||||
|
||||
const AppContainer = () => import('./Dashboard.vue');
|
||||
const Suspended = () => import('./suspended/Index.vue');
|
||||
|
||||
// const SetupProfile = () => import('v3/views/onboarding/SetupProfile.vue');
|
||||
// const SetupCompany = () => import('v3/views/onboarding/SetupCompany.vue');
|
||||
// const InviteTeam = () => import('v3/views/onboarding/InviteTeam.vue');
|
||||
// const FoundersNote = () => import('v3/views/onboarding/FoundersNote.vue');
|
||||
export default {
|
||||
routes: [
|
||||
...helpcenterRoutes.routes,
|
||||
@@ -29,5 +32,25 @@ export default {
|
||||
roles: ['administrator', 'agent'],
|
||||
component: Suspended,
|
||||
},
|
||||
// {
|
||||
// path: frontendURL('accounts/:account_id/start/setup-profile'),
|
||||
// name: 'onboarding_setup_profile',
|
||||
// component: SetupProfile,
|
||||
// },
|
||||
// {
|
||||
// path: frontendURL('accounts/:account_id/start/setup-company'),
|
||||
// name: 'onboarding_setup_company',
|
||||
// component: SetupCompany,
|
||||
// },
|
||||
// {
|
||||
// path: frontendURL('accounts/:account_id/start/invite-team'),
|
||||
// name: 'onboarding_invite_team',
|
||||
// component: InviteTeam,
|
||||
// },
|
||||
// {
|
||||
// path: frontendURL('accounts/:account_id/start/founders-note'),
|
||||
// name: 'onboarding_founders_note',
|
||||
// component: FoundersNote,
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -28,8 +28,6 @@ export const login = async ({
|
||||
export const register = async creds => {
|
||||
try {
|
||||
const response = await wootAPI.post('api/v1/accounts.json', {
|
||||
account_name: creds.accountName.trim(),
|
||||
user_full_name: creds.fullName.trim(),
|
||||
email: creds.email,
|
||||
password: creds.password,
|
||||
h_captcha_client_response: creds.hCaptchaClientResponse,
|
||||
@@ -42,6 +40,20 @@ export const register = async creds => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export const accountSetup = async ({ id, name, locale }) => {
|
||||
try {
|
||||
const response = await wootAPI.put(`api/v1/accounts/${id}.json`, {
|
||||
name,
|
||||
locale,
|
||||
});
|
||||
setAuthCredentials(response);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throwErrorMessage(error);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export const verifyPasswordToken = async ({ confirmationToken }) => {
|
||||
try {
|
||||
const response = await wootAPI.post('auth/confirmation', {
|
||||
|
||||
Reference in New Issue
Block a user