refactor: rename userSwitchTo
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m6s

This commit is contained in:
2025-09-18 11:50:02 -04:00
parent 3cc4b570d5
commit 4e9ad82d96
9 changed files with 72 additions and 66 deletions

View File

@@ -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();

View File

@@ -0,0 +1,10 @@
mutation switchTo($userId: ID!) {
switchTo(input: { userId: $userId }) {
authToken
refreshToken
user {
id
email
}
}
}

View File

@@ -1,10 +0,0 @@
mutation userSwitchTo($userId: ID!) {
userSwitchTo(input: { userId: $userId }) {
authToken
refreshToken
user {
id
email
}
}
}