feat: implement real profile save functionality
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s

This commit is contained in:
Cauê Faleiros
2026-02-26 10:42:01 -03:00
parent 6fb86b4806
commit 76b919d857
5 changed files with 3359 additions and 8 deletions

View File

@@ -57,6 +57,20 @@ export const getUserById = async (id: string): Promise<User | undefined> => {
}
};
export const updateUser = async (id: string, userData: { name: string, bio: string }): Promise<boolean> => {
try {
const response = await fetch(`${API_URL}/users/${id}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(userData)
});
return response.ok;
} catch (error) {
console.error("API Error (updateUser):", error);
return false;
}
};
export const getAttendanceById = async (id: string): Promise<Attendance | undefined> => {
try {
const response = await fetch(`${API_URL}/attendances/${id}`);