Files
nginx-proxy-manager/frontend/src/api/backend/createUser.ts
2025-10-02 08:12:36 +10:00

26 lines
489 B
TypeScript

import * as api from "./base";
import type { User } from "./models";
export interface AuthOptions {
type: string;
secret: string;
}
export interface NewUser {
name: string;
nickname: string;
email: string;
isDisabled?: boolean;
auth?: AuthOptions;
roles?: string[];
}
export async function createUser(item: NewUser, noAuth?: boolean): Promise<User> {
return await api.post({
url: "/users",
// todo: only use whitelist of fields for this data
data: item,
noAuth,
});
}