username-fix

This commit is contained in:
tonyrewin 2022-10-22 12:18:12 +03:00
commit 5c97536d76
3 changed files with 6 additions and 5 deletions

View File

@ -1,8 +1,8 @@
import { gql } from '@urql/core'
export default gql`
mutation RegisterMutation($email: String!, $password: String, $username: String) {
registerUser(email: $email, password: $password, username: $username) {
mutation RegisterMutation($email: String!, $password: String, $name: String) {
registerUser(email: $email, password: $password, name: $name) {
error
token
user {

View File

@ -261,7 +261,7 @@ export type MutationRateUserArgs = {
export type MutationRegisterUserArgs = {
email: Scalars['String']
password?: InputMaybe<Scalars['String']>
username?: InputMaybe<Scalars['String']>
name?: InputMaybe<Scalars['String']>
}
export type MutationRemoveAuthorArgs = {

View File

@ -65,9 +65,10 @@ export const apiClient = {
return response.data.signIn
},
authRegister: async ({ email, password = '', username = '' }): Promise<AuthResult> => {
authRegister: async ({ email, password = '', name = '' }): Promise<AuthResult> => {
// NOTE: name is to display
const response = await publicGraphQLClient
.mutation(authRegisterMutation, { email, password, username })
.mutation(authRegisterMutation, { email, password, name })
.toPromise()
return response.data.registerUser
},