mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -14,15 +14,15 @@ export function UserSettings({ userId }) {
|
|||
const [tab, setTab] = useState('details');
|
||||
const { get, useQuery } = useApi();
|
||||
const { showToast } = useToasts();
|
||||
const { data, isLoading } = useQuery(
|
||||
['user', userId],
|
||||
() => {
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ['user', userId],
|
||||
queryFn: () => {
|
||||
if (userId) {
|
||||
return get(`/users/${userId}`);
|
||||
}
|
||||
},
|
||||
{ cacheTime: 0 },
|
||||
);
|
||||
cacheTime: 0,
|
||||
});
|
||||
|
||||
const handleSave = data => {
|
||||
showToast({ message: formatMessage(messages.saved), variant: 'success' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue