mealie/frontend/api/admin/admin-users.ts
Hayden 791aa8c610
feat(backend): refactor/fix group management for admins (#838)
* fix(frontend): 🐛 update dialog implementation to simplify state management

* test(backend):  refactor test fixtures + admin group tests

* chore(backend): 🔨 add launcher.json for python debugging (tests)

* fix typing

* feat(backend):  refactor/fix group management for admins

* feat(frontend):  add/fix admin group management

* add LDAP checker

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-11-25 14:17:02 -09:00

39 lines
785 B
TypeScript

import { BaseCRUDAPI } from "../_base";
const prefix = "/api";
export interface UserCreate {
username: string;
fullName: string;
email: string;
admin: boolean;
group: string;
advanced: boolean;
canInvite: boolean;
canManage: boolean;
canOrganize: boolean;
password: string;
}
export interface UserToken {
name: string;
id: number;
createdAt: Date;
}
export interface UserRead extends UserToken {
id: number;
groupId: number;
favoriteRecipes: any[];
tokens: UserToken[];
}
const routes = {
adminUsers: `${prefix}/admin/users`,
adminUsersId: (tag: string) => `${prefix}/admin/users/${tag}`,
};
export class AdminUsersApi extends BaseCRUDAPI<UserRead, UserCreate> {
baseRoute: string = routes.adminUsers;
itemRoute = routes.adminUsersId;
}