implement frontend of user edit
This commit is contained in:
1 parent
8336ea199d
commit
4f68a76674
17 files changed
+449
-60
No files matched your search
@@ -1099,6 +1099,24 @@ class NetworkService {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async getUserById(config) {
|
||||
const userId = config?.userId;
|
||||
return this.axiosInstance.get(`auth/users/${userId}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async editUser(config) {
|
||||
const { userId, user } = config;
|
||||
return this.axiosInstance.put(`auth/users/${userId}`, user, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default NetworkService;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
export const ROLES = {
|
||||
SUPERADMIN: "superadmin",
|
||||
ADMIN: "admin",
|
||||
USER: "user",
|
||||
DEMO: "demo",
|
||||
};
|
||||
|
||||
export const EDITABLE_ROLES = [
|
||||
{ role: ROLES.ADMIN, _id: ROLES.ADMIN },
|
||||
{ role: ROLES.USER, _id: ROLES.USER },
|
||||
];
|
||||
Reference in new issue
Block a user