Extract applyInterceptWarmup utility to unify all credential building call sites: - Fix upstream account creation missing intercept_warmup_requests write - Fix apikey edit mode missing else-branch to clear the setting - Add backend unit test for IsInterceptWarmupEnabled - Add frontend unit test for credentialsBuilder
12 lines
287 B
TypeScript
12 lines
287 B
TypeScript
export function applyInterceptWarmup(
|
|
credentials: Record<string, unknown>,
|
|
enabled: boolean,
|
|
mode: 'create' | 'edit'
|
|
): void {
|
|
if (enabled) {
|
|
credentials.intercept_warmup_requests = true
|
|
} else if (mode === 'edit') {
|
|
delete credentials.intercept_warmup_requests
|
|
}
|
|
}
|