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

View File

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

View File

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