forked from jamesp/sasa-membership
More iteration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user