fix: address review feedback and code scanning alerts

This commit is contained in:
Cita
2026-03-22 23:41:45 +08:00
parent 32d7037629
commit 5d78658af9
38 changed files with 929 additions and 344 deletions
+5 -4
View File
@@ -516,15 +516,16 @@ export async function listOauthConnections(options: {
routeChannelCountByAccount.set(row.accountId, row.count ?? 0);
}
const items = rows.map((row) => {
const oauth = getOauthInfoFromAccount(row.accounts)!;
const items = rows.flatMap((row) => {
const oauth = getOauthInfoFromAccount(row.accounts);
if (!oauth) return [];
const models = modelMap.get(row.accounts.id) || [];
const status = (
oauth.modelDiscoveryStatus === 'abnormal'
|| row.accounts.status !== 'active'
|| row.sites.status !== 'active'
) ? 'abnormal' : 'healthy';
return {
return [{
accountId: row.accounts.id,
siteId: row.sites.id,
provider: oauth.provider,
@@ -546,7 +547,7 @@ export async function listOauthConnections(options: {
url: row.sites.url,
platform: row.sites.platform,
},
};
}];
});
return { items, total, limit, offset };