schon/storefront/graphql/mutations/auth.ts
Alexandr SaVBaD Waltz c60ac13e88 Features: 1) Introduce handleDeposit function with validation logic and deposit transaction flow; 2) Add useDeposit composable and balance.vue page for user account balance management; 3) Enhance wishlist and cart functionality with authentication checks and notification improvements;
Fixes: 1) Replace `ElNotification` with `useNotification` across all components and composables; 2) Add missing semicolons, consistent formatting, and type annotations in multiple files; 3) Resolve non-reactive elements in wishlist and cart state management;

Extra: 1) Update i18n translations with new strings for promocodes, balance, authentication, and profile settings; 2) Refactor SCSS styles including variable additions and component-specific tweaks; 3) Remove redundant queries, unused imports, and `storePage.ts` file for cleanup.
2025-07-08 23:41:31 +03:00

91 lines
No EOL
1.6 KiB
TypeScript

import {USER_FRAGMENT} from "~/graphql/fragments/user.fragment";
export const REGISTER = gql`
mutation register(
$firstName: String!,
$lastName: String!,
$email: String!,
$phoneNumber: String!,
$password: String!,
$confirmPassword: String!,
$referrer: String!,
) {
createUser(
firstName: $firstName,
lastName: $lastName,
email: $email,
phoneNumber: $phoneNumber,
password: $password,
confirmPassword: $confirmPassword,
referrer: $referrer
) {
success
}
}
`
export const LOGIN = gql`
mutation login(
$email: String!,
$password: String!
) {
obtainJwtToken(
email: $email,
password: $password
) {
accessToken
refreshToken
user {
...User
}
}
}
${USER_FRAGMENT}
`
export const REFRESH = gql`
mutation refresh(
$refreshToken: String!
) {
refreshJwtToken(
refreshToken: $refreshToken
) {
accessToken
refreshToken
user {
...User
}
}
}
${USER_FRAGMENT}
`
export const RESET_PASSWORD = gql`
mutation resetPassword(
$email: String!,
) {
resetPassword(
email: $email,
) {
success
}
}
`
export const NEW_PASSWORD = gql`
mutation confirmResetPassword(
$password: String!,
$confirmPassword: String!,
$token: String!,
$uid: String!,
) {
confirmResetPassword(
password: $password,
confirmPassword: $confirmPassword,
token: $token,
uid: $uid
) {
success
}
}
`