refactor: rename upsertSourceConfig to saveSourceConfig

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-04-12 13:59:58 +00:00
parent 6f720cbfe7
commit 476ef39b3d
4 changed files with 20 additions and 18 deletions

View File

@@ -79,11 +79,14 @@ export function SourceConfigPanel({ source, onUpdate }: SourceConfigPanelProps)
(v) => typeof v === "string" && v.length > 0,
)
await replaceSource(source.id, {
const body: Parameters<typeof replaceSource>[1] = {
enabled,
config: getUserConfig(),
...(hasCredentials && source.perUserCredentials ? { credentials: credentialFields } : {}),
})
}
if (hasCredentials && source.perUserCredentials) {
body.credentials = credentialFields
}
await replaceSource(source.id, body)
// For non-per-user credentials (provider-level), still use the admin endpoint.
if (hasCredentials && !source.perUserCredentials) {