feat: marca Uriel Jareth Consulting, API segura para agentes, aprobacion humana y webhooks HMAC
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { prisma } from "./db";
|
||||
|
||||
export const DEFAULT_COLOR_PRIMARIO = "#0400C4";
|
||||
export const DEFAULT_COLOR_SECUNDARIO = "#0F172A";
|
||||
|
||||
export async function getConfigBranding() {
|
||||
try {
|
||||
const configs = await prisma.configuracion.findMany({
|
||||
@@ -8,13 +11,24 @@ export async function getConfigBranding() {
|
||||
const map: Record<string, string> = {};
|
||||
for (const c of configs) map[c.clave] = c.valor;
|
||||
return {
|
||||
colorPrimario: map.color_primario || undefined,
|
||||
colorSecundario: map.color_secundario || undefined,
|
||||
logoBase64: map.logo_base64 ? (map.logo_base64.includes(":") ? map.logo_base64.split(":").slice(1).join(":") : map.logo_base64) : undefined,
|
||||
logoMime: map.logo_base64 ? (map.logo_base64.includes(":") ? map.logo_base64.split(":")[0] : "image/png") : undefined,
|
||||
colorPrimario: map.color_primario || DEFAULT_COLOR_PRIMARIO,
|
||||
colorSecundario: map.color_secundario || DEFAULT_COLOR_SECUNDARIO,
|
||||
logoBase64: map.logo_base64
|
||||
? map.logo_base64.includes(":")
|
||||
? map.logo_base64.split(":").slice(1).join(":")
|
||||
: map.logo_base64
|
||||
: undefined,
|
||||
logoMime: map.logo_base64
|
||||
? map.logo_base64.includes(":")
|
||||
? map.logo_base64.split(":")[0]
|
||||
: "image/png"
|
||||
: undefined,
|
||||
};
|
||||
} catch {
|
||||
return {};
|
||||
return {
|
||||
colorPrimario: DEFAULT_COLOR_PRIMARIO,
|
||||
colorSecundario: DEFAULT_COLOR_SECUNDARIO,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user