More iteration

This commit is contained in:
James Pattinson
2025-11-10 15:20:11 +00:00
parent 93aeda8e83
commit f1c4ff19d6
9 changed files with 491 additions and 12 deletions
@@ -71,6 +71,11 @@ export interface ResetPasswordData {
new_password: string;
}
export interface ChangePasswordData {
current_password: string;
new_password: string;
}
export interface MembershipCreateData {
tier_id: number;
start_date: string;
@@ -121,6 +126,11 @@ export const authService = {
return response.data;
},
async changePassword(data: ChangePasswordData) {
const response = await api.post('/auth/change-password', data);
return response.data;
},
logout() {
localStorage.removeItem('token');
},
@@ -144,6 +154,11 @@ export const userService = {
async getAllUsers(): Promise<User[]> {
const response = await api.get('/users/');
return response.data;
},
async updateUserRole(userId: number, role: string): Promise<User> {
const response = await api.put(`/users/${userId}`, { role });
return response.data;
}
};