diff --git a/src/context/profile.tsx b/src/context/profile.tsx index b8481763..0d59335f 100644 --- a/src/context/profile.tsx +++ b/src/context/profile.tsx @@ -33,7 +33,7 @@ export const ProfileFormProvider = (props: { children: JSX.Element }) => { const [form, setForm] = createStore({}) const submit = async (profile: ProfileInput) => { - const response = await apiClient.updateProfile(profile) + const response = await apiClient.updateAuthor(profile) if (response.error) { console.error(response.error) throw response.error diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index 90402a4f..c4db6b26 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -8,7 +8,7 @@ import type { ReactionInput, ReactionBy, Shout, - Result, + CommonResult, QueryLoad_Authors_ByArgs, QueryLoad_Shouts_SearchArgs, QueryLoad_Shouts_Random_TopArgs, @@ -26,7 +26,7 @@ import reactionCreate from '../mutation/core/reaction-create' import reactionDestroy from '../mutation/core/reaction-destroy' import reactionUpdate from '../mutation/core/reaction-update' import unfollowMutation from '../mutation/core/unfollow' -import updateProfile from '../mutation/core/update-profile' +import updateAuthor from '../mutation/core/author-update' import shoutLoad from '../query/core/article-load' import shoutsLoadBy from '../query/core/articles-load-by' import draftsLoad from '../query/core/articles-load-drafts' @@ -137,9 +137,9 @@ export const apiClient = { const response = await publicGraphQLClient.query(authorFollowedCommunities, { slug }).toPromise() return response.data.get_communities_by_author }, - updateProfile: async (input: ProfileInput) => { - const response = await apiClient.private.mutation(updateProfile, { profile: input }).toPromise() - return response.data.update_profile + updateAuthor: async (input: ProfileInput) => { + const response = await apiClient.private.mutation(updateAuthor, { profile: input }).toPromise() + return response.data.update_author }, getTopic: async ({ slug }: { slug: string }): Promise => { const response = await publicGraphQLClient.query(topicBySlug, { slug }).toPromise() @@ -233,7 +233,7 @@ export const apiClient = { .toPromise() return resp.data.load_reactions_by }, - getMySubscriptions: async (): Promise => { + getMySubscriptions: async (): Promise => { const resp = await apiClient.private.query(mySubscriptions, {}).toPromise() return resp.data.get_my_followed diff --git a/src/graphql/mutation/core/update-profile.ts b/src/graphql/mutation/core/author-update.ts similarity index 81% rename from src/graphql/mutation/core/update-profile.ts rename to src/graphql/mutation/core/author-update.ts index a33ecc6f..fe8a337a 100644 --- a/src/graphql/mutation/core/update-profile.ts +++ b/src/graphql/mutation/core/author-update.ts @@ -2,7 +2,7 @@ import { gql } from '@urql/core' export default gql` mutation ProfileUpdateMutation($profile: ProfileInput!) { - update_profile(profile: $profile) { + update_author(profile: $profile) { error author { name