Refactor personal account components for data fetching efficiency
Refactored personal account components to centralize user data fetching and subsequently reduce and distribute calls. Instead of fetching user data individually in `UpdateAccountImageContainer`, `UpdateAccountDetailsFormContainer` and `UpdateAccountNameFormContainer`, data fetching is now performed in the parent component, `AccountSettingsContainer`. Also, implemented partial loading state.
This commit is contained in:
@@ -51,7 +51,13 @@ export function usePersonalAccountData(
|
||||
enabled: !!userId,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnMount: false,
|
||||
initialData: partialAccount,
|
||||
initialData: partialAccount?.id
|
||||
? {
|
||||
id: partialAccount.id,
|
||||
name: partialAccount.name,
|
||||
picture_url: partialAccount.picture_url,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user