[Glitch] Add profile setup to onboarding in web UI

Port d67bd44ca1 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2023-11-15 12:13:53 +01:00
committed by Claire
parent 3425b99a9a
commit bacb9134cc
16 changed files with 504 additions and 415 deletions

View File

@@ -714,6 +714,21 @@ export function fetchPinnedAccountsFail(error) {
};
}
export const updateAccount = ({ displayName, note, avatar, header, discoverable, indexable }) => (dispatch, getState) => {
const data = new FormData();
data.append('display_name', displayName);
data.append('note', note);
if (avatar) data.append('avatar', avatar);
if (header) data.append('header', header);
data.append('discoverable', discoverable);
data.append('indexable', indexable);
return api(getState).patch('/api/v1/accounts/update_credentials', data).then(response => {
dispatch(importFetchedAccount(response.data));
});
};
export function fetchPinnedAccountsSuggestions(q) {
return (dispatch, getState) => {
dispatch(fetchPinnedAccountsSuggestionsRequest());