feat: implement real profile save functionality
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user