[WiP] Save settings (buggy backend responce)

This commit is contained in:
ilya-bkv 2022-12-01 21:07:27 +03:00
parent 22ede100e5
commit c74235182c
3 changed files with 22 additions and 26 deletions

View File

@ -63,26 +63,26 @@ export const ProfileSettingsPage = (props: PageProps) => {
/> />
<label for="username">Имя</label> <label for="username">Имя</label>
</div> </div>
{/*Не готов бекенд*/}
<h4>{t('Address on Discourse')}</h4> {/*<h4>{t('Address on Discourse')}</h4>*/}
<div class="pretty-form__item"> {/*<div class="pretty-form__item">*/}
<div class={styles.discoursName}> {/* <div class={styles.discoursName}>*/}
<label for="user-address">https://discours.io/user/</label> {/* <label for="user-address">https://discours.io/user/</label>*/}
<div class={styles.discoursNameField}> {/* <div class={styles.discoursNameField}>*/}
<input {/* <input*/}
type="text" {/* type="text"*/}
name="user-address" {/* name="user-address"*/}
id="user-address" {/* id="user-address"*/}
onChange={(event) => updateFormField('slug', event.currentTarget.value)} {/* onChange={(event) => updateFormField('slug', event.currentTarget.value)}*/}
value={form.slug} {/* value={form.slug}*/}
class="nolabel" {/* class="nolabel"*/}
/> {/* />*/}
<p class="form-message form-message--error"> {/* <p class="form-message form-message--error">*/}
{t('Sorry, this address is already taken, please choose another one.')} {/* {t('Sorry, this address is already taken, please choose another one.')}*/}
</p> {/* </p>*/}
</div> {/* </div>*/}
</div> {/* </div>*/}
</div> {/*</div>*/}
{/*Нет реализации полей на бэке*/} {/*Нет реализации полей на бэке*/}
{/*<h4>{t('Introduce')}</h4>*/} {/*<h4>{t('Introduce')}</h4>*/}

View File

@ -7,10 +7,6 @@ export default gql`
error error
author { author {
name name
slug
userpic
bio
links
} }
} }
} }

View File

@ -216,8 +216,8 @@ export const apiClient = {
console.debug('getAuthor', response) console.debug('getAuthor', response)
return response.data.getAuthor return response.data.getAuthor
}, },
updateProfile: async (options: ProfileInput) => { updateProfile: async (input: ProfileInput) => {
const response = await privateGraphQLClient.mutation(updateProfile, options).toPromise() const response = await privateGraphQLClient.mutation(updateProfile, { profile: input }).toPromise()
console.debug('updateProfile', response) console.debug('updateProfile', response)
}, },
getTopic: async ({ slug }: { slug: string }): Promise<Topic> => { getTopic: async ({ slug }: { slug: string }): Promise<Topic> => {