State management

This commit is contained in:
Sean Edmunds
2025-05-02 14:50:14 -05:00
parent 16787969fc
commit 97a59d6a15
21 changed files with 525 additions and 320 deletions

View File

@@ -17,8 +17,9 @@ const PersonalizationSettings = () => {
const [personal, setPersonal] = useState<PersonalData>();
const [update, setUpdate] = useState<any>({});
const [debounced] = useDebouncedValue(update, 1000);
const { mutateAsync: editRow } = useMutationAPI();
const { mutateAsync } = useMutationAPI();
const { isMobile } = useCommonHooks();
useEffect(() => {
if (personalData && personalIsFetched) {
setPersonal(personalData[0]);
@@ -28,7 +29,7 @@ const PersonalizationSettings = () => {
useEffect(() => {
if (Object.keys(debounced).length) {
setPersonal(update);
editRow({ method: 'PATCH', endpoint: endpoint, body: debounced });
mutateAsync({ method: 'PATCH', endpoint: endpoint, body: debounced });
setUpdate({});
}
}, [debounced]);
@@ -61,6 +62,8 @@ const PersonalizationSettings = () => {
searchValue={undefined}
setSearchValue={() => {}}
searchPlaceholder={undefined}
isLoading={false}
setIsLoading={() => {}}
/>
<Stack
align='center'