File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
103
103
queryFn : async ( ) => {
104
104
try {
105
105
if ( ! isVerified || isUndefined ( address ) ) return undefined ;
106
- return await fetchUser ( atlasGqlClient , address ) ;
106
+ return await fetchUser ( atlasGqlClient ) ;
107
107
} catch {
108
108
return undefined ;
109
109
}
@@ -159,7 +159,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
159
159
if ( ! address || ! isVerified ) return false ;
160
160
setIsAddingUser ( true ) ;
161
161
162
- const userAdded = await addUserToAtlas ( atlasGqlClient , { address , ... userSettings } ) ;
162
+ const userAdded = await addUserToAtlas ( atlasGqlClient , userSettings ) ;
163
163
refetchUser ( ) ;
164
164
165
165
return userAdded ;
Original file line number Diff line number Diff line change 1
1
import { gql , type GraphQLClient } from "graphql-request" ;
2
2
import { toast } from "react-toastify" ;
3
- import { Address } from "viem" ;
4
3
5
4
import { OPTIONS } from "utils/wrapWithToast" ;
6
5
@@ -11,7 +10,6 @@ const query = gql`
11
10
` ;
12
11
13
12
export type AddUserData = {
14
- address ?: Address ;
15
13
email : string ;
16
14
} ;
17
15
Original file line number Diff line number Diff line change @@ -14,25 +14,21 @@ export type User = {
14
14
} ;
15
15
16
16
const query = gql `
17
- query GetUser($address: String!) {
18
- user(address: $address) {
17
+ query GetUser {
18
+ user {
19
19
email
20
20
}
21
21
}
22
22
` ;
23
23
24
- export function fetchUser ( client : GraphQLClient , address : string ) : Promise < User > {
25
- const variables = {
26
- address,
27
- } ;
28
-
24
+ export function fetchUser ( client : GraphQLClient ) : Promise < User > {
29
25
return toast . promise < User , Error > (
30
26
client
31
- . request < GetUserResponse > ( query , variables )
27
+ . request < GetUserResponse > ( query )
32
28
. then ( ( response ) => response . user )
33
29
. catch ( ( errors ) => {
34
30
// eslint-disable-next-line no-console
35
- console . log ( "Error fetching user :" , address , { errors } ) ;
31
+ console . log ( "Error fetching user :" , { errors } ) ;
36
32
const errorMessage = Array . isArray ( errors ?. response ?. errors )
37
33
? errors . response . errors [ 0 ] ?. message
38
34
: "Error user nonce" ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { toast } from "react-toastify";
4
4
import { OPTIONS } from "utils/wrapWithToast" ;
5
5
6
6
const query = gql `
7
- mutation UpdateUser($settings: UpdateUserDto !) {
7
+ mutation UpdateUser($settings: UpdateUserSettingsDto !) {
8
8
updateUser(updateUserSettings: $settings)
9
9
}
10
10
` ;
You can’t perform that action at this time.
0 commit comments