diff --git a/src/routes/integrations.js b/src/routes/integrations.js index 6cef6c3..07abeec 100644 --- a/src/routes/integrations.js +++ b/src/routes/integrations.js @@ -12,12 +12,17 @@ function decryptSecrets(row) { function maskRow(row) { const schema = INTEGRATIONS[row.slug] + // Always return all schema-defined config fields, even if not yet saved + const config = {} + for (const f of schema?.configFields ?? []) { + config[f] = row.config?.[f] ?? '' + } const existing = decryptSecrets(row) const masked = {} for (const f of schema?.secretFields ?? []) { masked[f] = existing[f] ? MASKED : null } - return { slug: row.slug, name: row.name, config: row.config, secrets: masked, enabled: row.enabled, updated_at: row.updated_at } + return { slug: row.slug, name: row.name, config, secrets: masked, enabled: row.enabled, updated_at: row.updated_at } } export async function integrationRoutes(app) {