refactor: gestión de módulos de correo al portal IT
This commit is contained in:
1 parent
e83bc239c0
commit
7009d8756d
3 files changed
+4
-175
No files matched your search
@@ -361,11 +361,6 @@ export interface EmailLogEntry {
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface EmailModule {
|
||||
module: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export async function getEmailTemplates() {
|
||||
return fetchApi<EmailTemplate[]>("/api/email/templates");
|
||||
}
|
||||
@@ -399,23 +394,6 @@ export async function getEmailLog(limit = 50, module = "helpdesk") {
|
||||
return fetchApi<EmailLogEntry[]>(`/api/email/log?${query.toString()}`);
|
||||
}
|
||||
|
||||
export async function getEmailModules() {
|
||||
return fetchApi<EmailModule[]>("/api/email/modules");
|
||||
}
|
||||
|
||||
export async function registerEmailModule(module: string) {
|
||||
return fetchApi<{ module: string; apiKey: string }>("/api/email/modules", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ module }),
|
||||
});
|
||||
}
|
||||
|
||||
export async function revokeEmailModule(module: string) {
|
||||
return fetchApi<{ module: string }>(`/api/email/modules/${encodeURIComponent(module)}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
|
||||
// Envío vía route handler propio (/api/correos) → POST /api/email/send con
|
||||
// X-Module + X-Api-Key en el servidor (la clave nunca va en el bundle).
|
||||
// Reenvía el Bearer de admin para que el route verifique el rol.
|
||||
|
||||
Reference in new issue
Block a user