added changing password frontend backend

This commit is contained in:
2025-10-13 11:57:27 +02:00
parent 6de3216dcd
commit dec92daf7c
8 changed files with 595 additions and 25 deletions

View File

@@ -117,6 +117,19 @@ export class EmployeeService {
return response.json();
}
async changePassword(id: string, data: { currentPassword: string, newPassword: string }): Promise<void> {
const response = await fetch(`${API_BASE_URL}/employees/${id}/password`, {
method: 'PUT',
headers: getAuthHeaders(),
body: JSON.stringify(data),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'Failed to change password');
}
}
}
export const employeeService = new EmployeeService();