Merge pull request 'fixes' (#4) from feature/personal-account into master
Some checks failed
Build and Publish Images / build-and-push (push) Failing after 7s
Some checks failed
Build and Publish Images / build-and-push (push) Failing after 7s
Reviewed-on: http://192.168.31.100:3847/Arrelin/family_budget/pulls/4
This commit was merged in pull request #4.
This commit is contained in:
@@ -40,12 +40,28 @@ export default function Profile() {
|
||||
const [newFamilyName, setNewFamilyName] = useState('');
|
||||
const [savingName, setSavingName] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (user?.family_id) {
|
||||
loadFamily();
|
||||
}
|
||||
}, [user?.family_id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (user?.family_id && selectedFamily) {
|
||||
loadMembers();
|
||||
}
|
||||
}, [user?.family_id, selectedFamily]);
|
||||
|
||||
const loadFamily = async () => {
|
||||
if (!user?.family_id) return;
|
||||
try {
|
||||
const response = await familyApi.get(user.family_id);
|
||||
setSelectedFamily(response.data);
|
||||
} catch (err) {
|
||||
console.error('Error loading family:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const loadMembers = async () => {
|
||||
if (!user?.family_id) return;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user