mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-05-04 21:32:40 +02:00
Add user management features to admin section
- Add ability to create new users from admin panel - Add role dropdown (User/Admin) for each user - Replace toggle buttons with select dropdown for role management - Admin users can access the Admin section in settings - Regular users see only Profile and Notifications sections Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f46c6ad9d4
commit
040cdb9c42
3 changed files with 200 additions and 25 deletions
|
|
@ -172,6 +172,13 @@ export interface SystemSettings {
|
|||
export const adminApi = {
|
||||
getUsers: () => api.get<UserProfile[]>('/admin/users'),
|
||||
|
||||
createUser: (email: string, password: string, isAdmin: boolean) =>
|
||||
api.post<{ message: string; user: UserProfile }>('/admin/users', {
|
||||
email,
|
||||
password,
|
||||
is_admin: isAdmin,
|
||||
}),
|
||||
|
||||
deleteUser: (id: number) => api.delete(`/admin/users/${id}`),
|
||||
|
||||
setUserAdmin: (id: number, isAdmin: boolean) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue