mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 21:29:40 +02:00
29 lines
511 B
TypeScript
29 lines
511 B
TypeScript
|
import { BaseAPI } from "./_base";
|
||
|
|
||
|
const routes = {
|
||
|
base: "/api/admin/email",
|
||
|
};
|
||
|
|
||
|
export interface CheckEmailResponse {
|
||
|
ready: boolean;
|
||
|
}
|
||
|
|
||
|
export interface TestEmailResponse {
|
||
|
success: boolean;
|
||
|
error: string;
|
||
|
}
|
||
|
|
||
|
export interface TestEmailPayload {
|
||
|
email: 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);
|
||
|
}
|
||
|
}
|