Client - update user typing

This commit is contained in:
Sam
2022-03-13 09:50:09 +01:00
parent ac6aceadfd
commit 0b1d99aa7a
16 changed files with 41 additions and 37 deletions

View File

@ -5,12 +5,12 @@ import {
IAuthUserState,
TAuthUserMutations,
} from '@/store/modules/authUser/types'
import { IUserProfile } from '@/types/user'
import { IAuthUserProfile } from '@/types/user'
export const mutations: MutationTree<IAuthUserState> & TAuthUserMutations = {
[AUTH_USER_STORE.MUTATIONS.CLEAR_AUTH_USER_TOKEN](state: IAuthUserState) {
state.authToken = null
state.authUserProfile = <IUserProfile>{}
state.authUserProfile = <IAuthUserProfile>{}
},
[AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN](
state: IAuthUserState,
@ -20,7 +20,7 @@ export const mutations: MutationTree<IAuthUserState> & TAuthUserMutations = {
},
[AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE](
state: IAuthUserState,
authUserProfile: IUserProfile
authUserProfile: IAuthUserProfile
) {
state.authUserProfile = authUserProfile
},

View File

@ -1,9 +1,9 @@
import { IAuthUserState } from '@/store/modules/authUser/types'
import { IUserProfile } from '@/types/user'
import { IAuthUserProfile } from '@/types/user'
export const authUserState: IAuthUserState = {
authToken: null,
authUserProfile: <IUserProfile>{},
authUserProfile: <IAuthUserProfile>{},
isSuccess: false,
loading: false,
}

View File

@ -8,7 +8,7 @@ import {
import { AUTH_USER_STORE } from '@/store/constants'
import { IRootState } from '@/store/modules/root/types'
import {
IUserProfile,
IAuthUserProfile,
ILoginOrRegisterData,
IUserDeletionPayload,
IUserPasswordPayload,
@ -23,7 +23,7 @@ import {
export interface IAuthUserState {
authToken: string | null
authUserProfile: IUserProfile
authUserProfile: IAuthUserProfile
isSuccess: boolean
loading: boolean
}
@ -106,7 +106,7 @@ export interface IAuthUserGetters {
[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE](
state: IAuthUserState
): IUserProfile
): IAuthUserProfile
[AUTH_USER_STORE.GETTERS.IS_ADMIN](state: IAuthUserState): boolean
@ -125,7 +125,7 @@ export type TAuthUserMutations<S = IAuthUserState> = {
): void
[AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE](
state: S,
authUserProfile: IUserProfile
authUserProfile: IAuthUserProfile
): void
[AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS](
state: S,