5d43fac7c9
* style(frontend): 💄 add darktheme custom * add dummy users in dev mode * feat(frontend): ✨ add group permissions editor UI * feat(backend): ✨ add group permissions setters * test(backend): ✅ tests for basic permission get/set (WIP) Needs more testing * remove old test * chore(backend): copy template.env on setup * feat(frontend): ✨ enable send invitation via email * feat(backend): ✨ enable send invitation via email * feat: ✨ add app config checker for site-settings * refactor(frontend): ♻️ consolidate bool checks Co-authored-by: Hayden <hay-kot@pm.me>
44 lines
848 B
TypeScript
44 lines
848 B
TypeScript
import { BaseAPI } from "./_base";
|
|
|
|
const routes = {
|
|
base: "/api/admin/email",
|
|
|
|
invitation: "/api/groups/invitations/email",
|
|
};
|
|
|
|
export interface CheckEmailResponse {
|
|
ready: boolean;
|
|
}
|
|
|
|
export interface TestEmailResponse {
|
|
success: boolean;
|
|
error: string;
|
|
}
|
|
|
|
export interface TestEmailPayload {
|
|
email: string;
|
|
}
|
|
|
|
export interface InvitationEmail {
|
|
email: string;
|
|
token: string;
|
|
}
|
|
|
|
export interface InvitationEmailResponse {
|
|
success: boolean;
|
|
error: string;
|
|
}
|
|
|
|
export class EmailAPI extends BaseAPI {
|
|
check() {
|
|
return this.requests.get<CheckEmailResponse>(routes.base);
|
|
}
|
|
|
|
test(payload: TestEmailPayload) {
|
|
return this.requests.post<TestEmailResponse>(routes.base, payload);
|
|
}
|
|
|
|
sendInvitation(payload: InvitationEmail) {
|
|
return this.requests.post<InvitationEmailResponse>(routes.invitation, payload);
|
|
}
|
|
}
|