Client - add privacy review when user has not accepted the last policy
This commit is contained in:
@ -427,4 +427,24 @@ export const actions: ActionTree<IAuthUserState, IRootState> &
|
||||
})
|
||||
.catch((error) => handleError(context, error))
|
||||
},
|
||||
[AUTH_USER_STORE.ACTIONS.ACCEPT_PRIVACY_POLICY](
|
||||
context: ActionContext<IAuthUserState, IRootState>,
|
||||
acceptedPolicy: boolean
|
||||
): void {
|
||||
context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)
|
||||
authApi
|
||||
.post('auth/account/privacy-policy', {
|
||||
accepted_policy: acceptedPolicy,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.status === 'success') {
|
||||
context
|
||||
.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)
|
||||
.then(() => router.push('/profile'))
|
||||
} else {
|
||||
handleError(context, null)
|
||||
}
|
||||
})
|
||||
.catch((error) => handleError(context, error))
|
||||
},
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
export enum AuthUserActions {
|
||||
ACCEPT_PRIVACY_POLICY = 'ACCEPT_PRIVACY_POLICY',
|
||||
CHECK_AUTH_USER = 'CHECK_AUTH_USER',
|
||||
CONFIRM_ACCOUNT = 'CONFIRM_ACCOUNT',
|
||||
CONFIRM_EMAIL = 'CONFIRM_EMAIL',
|
||||
|
@ -110,6 +110,11 @@ export interface IAuthUserActions {
|
||||
[AUTH_USER_STORE.ACTIONS.DELETE_PICTURE](
|
||||
context: ActionContext<IAuthUserState, IRootState>
|
||||
): void
|
||||
|
||||
[AUTH_USER_STORE.ACTIONS.ACCEPT_PRIVACY_POLICY](
|
||||
context: ActionContext<IAuthUserState, IRootState>,
|
||||
acceptedPolicy: boolean
|
||||
): void
|
||||
}
|
||||
|
||||
export interface IAuthUserGetters {
|
||||
|
Reference in New Issue
Block a user