just another day of my life

This commit is contained in:
2024-10-11 13:46:46 -05:00
parent 38f073c5ac
commit 56206c1665
6 changed files with 376 additions and 88 deletions

View File

@ -17,3 +17,18 @@ export const getUserData = async () => {
return null;
}
};
export const updateUserData = async (updatedFields: Partial<any>) => {
try {
const currentUserData = await getUserData();
if (currentUserData) {
const updatedUserData = { ...currentUserData, ...updatedFields };
await saveUserData(updatedUserData);
return updatedUserData;
}
return null;
} catch (error) {
console.error('Error updating user data:', error);
return null;
}
};