fix: exponer es_agente_bot y telegram_config_id en respuesta de AI Config
This commit is contained in:
@@ -38,15 +38,17 @@ func GetAiConfigs(c *fiber.Ctx) error {
|
||||
|
||||
// Ocultar la API key en el listado (mostrar solo últimos 4 chars)
|
||||
type safe struct {
|
||||
ID uint `json:"ID"`
|
||||
Nombre string `json:"nombre"`
|
||||
Provider string `json:"provider"`
|
||||
ApiKeyHint string `json:"api_key_hint"`
|
||||
BaseURL string `json:"base_url"`
|
||||
ModelName string `json:"model_name"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Notes string `json:"notes"`
|
||||
Modulo string `json:"modulo"`
|
||||
ID uint `json:"ID"`
|
||||
Nombre string `json:"nombre"`
|
||||
Provider string `json:"provider"`
|
||||
ApiKeyHint string `json:"api_key_hint"`
|
||||
BaseURL string `json:"base_url"`
|
||||
ModelName string `json:"model_name"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Notes string `json:"notes"`
|
||||
Modulo string `json:"modulo"`
|
||||
EsAgenteBot bool `json:"es_agente_bot"`
|
||||
TelegramConfigID *uint `json:"telegram_config_id"`
|
||||
}
|
||||
safeItems := make([]safe, len(items))
|
||||
for i, it := range items {
|
||||
@@ -55,15 +57,17 @@ func GetAiConfigs(c *fiber.Ctx) error {
|
||||
hint = "••••" + it.ApiKey[len(it.ApiKey)-4:]
|
||||
}
|
||||
safeItems[i] = safe{
|
||||
ID: it.ID,
|
||||
Nombre: it.Nombre,
|
||||
Provider: it.Provider,
|
||||
ApiKeyHint: hint,
|
||||
BaseURL: it.BaseURL,
|
||||
ModelName: it.ModelName,
|
||||
IsActive: it.IsActive,
|
||||
Notes: it.Notes,
|
||||
Modulo: it.Modulo,
|
||||
ID: it.ID,
|
||||
Nombre: it.Nombre,
|
||||
Provider: it.Provider,
|
||||
ApiKeyHint: hint,
|
||||
BaseURL: it.BaseURL,
|
||||
ModelName: it.ModelName,
|
||||
IsActive: it.IsActive,
|
||||
Notes: it.Notes,
|
||||
Modulo: it.Modulo,
|
||||
EsAgenteBot: it.EsAgenteBot,
|
||||
TelegramConfigID: it.TelegramConfigID,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user