Client - refacto
This commit is contained in:
parent
feb4f0f7c3
commit
332983d9ea
@ -46,7 +46,7 @@ export const actions: ActionTree<IUsersState, IRootState> & IUsersActions = {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.status === 'success') {
|
if (res.data.status === 'success') {
|
||||||
context.commit(
|
context.commit(
|
||||||
USERS_STORE.MUTATIONS.UPDATE_USER,
|
USERS_STORE.MUTATIONS.UPDATE_USER_IN_USERS,
|
||||||
res.data.data.users[0]
|
res.data.data.users[0]
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -10,7 +10,7 @@ export enum UsersGetters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum UsersMutations {
|
export enum UsersMutations {
|
||||||
UPDATE_USER = 'UPDATE_USER',
|
UPDATE_USER_IN_USERS = 'UPDATE_USER_IN_USERS',
|
||||||
UPDATE_USERS = 'UPDATE_USERS',
|
UPDATE_USERS = 'UPDATE_USERS',
|
||||||
UPDATE_USERS_LOADING = 'UPDATE_USERS_LOADING',
|
UPDATE_USERS_LOADING = 'UPDATE_USERS_LOADING',
|
||||||
UPDATE_USERS_PAGINATION = 'UPDATE_USERS_PAGINATION',
|
UPDATE_USERS_PAGINATION = 'UPDATE_USERS_PAGINATION',
|
||||||
|
@ -6,7 +6,7 @@ import { IPagination } from '@/types/api'
|
|||||||
import { IUserProfile } from '@/types/user'
|
import { IUserProfile } from '@/types/user'
|
||||||
|
|
||||||
export const mutations: MutationTree<IUsersState> & TUsersMutations = {
|
export const mutations: MutationTree<IUsersState> & TUsersMutations = {
|
||||||
[USERS_STORE.MUTATIONS.UPDATE_USER](
|
[USERS_STORE.MUTATIONS.UPDATE_USER_IN_USERS](
|
||||||
state: IUsersState,
|
state: IUsersState,
|
||||||
updatedUser: IUserProfile
|
updatedUser: IUserProfile
|
||||||
) {
|
) {
|
||||||
|
@ -34,7 +34,10 @@ export interface IUsersGetters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type TUsersMutations<S = IUsersState> = {
|
export type TUsersMutations<S = IUsersState> = {
|
||||||
[USERS_STORE.MUTATIONS.UPDATE_USER](state: S, updatedUser: IUserProfile): void
|
[USERS_STORE.MUTATIONS.UPDATE_USER_IN_USERS](
|
||||||
|
state: S,
|
||||||
|
updatedUser: IUserProfile
|
||||||
|
): void
|
||||||
[USERS_STORE.MUTATIONS.UPDATE_USERS](state: S, users: IUserProfile[]): void
|
[USERS_STORE.MUTATIONS.UPDATE_USERS](state: S, users: IUserProfile[]): void
|
||||||
[USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING](state: S, loading: boolean): void
|
[USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING](state: S, loading: boolean): void
|
||||||
[USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION](
|
[USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION](
|
||||||
|
Loading…
Reference in New Issue
Block a user