Skip to content
Snippets Groups Projects
Commit 8eff2da8 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Fix response structure when generating invite roken

parent 66dd1624
No related branches found
No related tags found
1 merge request!45Generate invite tokens from admin-fe
......@@ -25,8 +25,8 @@ const invites = {
commit('SET_LOADING', false)
},
async GenerateInviteToken({ commit, dispatch, getters }, { maxUse, expiresAt }) {
const response = await generateInviteToken(maxUse, expiresAt, getters.authHost, getters.token)
commit('SET_NEW_TOKEN', { token: response.data, maxUse: response.config.invite.max_use, expiresAt: response.config.invite.expires_at })
const { data } = await generateInviteToken(maxUse, expiresAt, getters.authHost, getters.token)
commit('SET_NEW_TOKEN', { token: data.token, maxUse: data.max_use, expiresAt: data.expires_at })
dispatch('FetchInviteTokens')
},
async InviteUserViaEmail({ commit, dispatch, getters }, { email, name }) {
......
......@@ -19,16 +19,17 @@
:visible.sync="createTokenDialogVisible"
:show-close="false"
:title="$t('invites.createInviteToken')"
custom-class="create-user-dialog">
custom-class="create-new-token-dialog">
<el-form ref="newTokenForm" :model="newTokenForm" :label-width="getLabelWidth" status-icon>
<el-form-item :label="$t('invites.maxUse')">
<el-input-number v-model="newTokenForm.maxUse" :min="0"/>
<el-input-number v-model="newTokenForm.maxUse" :min="0" name="maxUse"/>
</el-form-item>
<el-form-item :label="$t('invites.expiresAt')">
<el-date-picker
v-model="newTokenForm.expiresAt"
:placeholder="$t('invites.pickDate')"
type="date"
name="date"
value-format="yyyy-MM-dd"/>
</el-form-item>
</el-form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment