generated from pascalmartineau/wp-skeleton
refactor: rename userSwitchTo
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m6s
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m6s
This commit is contained in:
@@ -7,8 +7,8 @@ export function useUserSwitching() {
|
||||
|
||||
async function userSwitchTo(userId: string | number) {
|
||||
try {
|
||||
const { data, errors } = await useGraphqlMutation("userSwitchTo", { userId });
|
||||
if (errors.length || !data.userSwitchTo) {
|
||||
const { data, errors } = await useGraphqlMutation("switchTo", { userId });
|
||||
if (errors.length || !data.switchTo) {
|
||||
throw new Error("Une erreur est survenue");
|
||||
}
|
||||
await refreshUserSession();
|
||||
|
||||
Reference in New Issue
Block a user