Skip to content

Commit

Permalink
fix: fix community openrank interface
Browse files Browse the repository at this point in the history
Signed-off-by: frank-zsy <[email protected]>
  • Loading branch information
frank-zsy committed Dec 7, 2024
1 parent 2a680bb commit 67ac97e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/metrics/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ export const getOutterOrderAndLimit = (config: QueryConfig, col: string, index?:
${config.limitOption === 'all' && config.limit > 0 ? `LIMIT ${config.limit}` : ''}`;
};

export const getTopLevelPlatform = (config: QueryConfig) => {
if (config.groupBy && config.groupBy !== 'org' && config.groupBy !== 'repo') {
export const getTopLevelPlatform = (config: QueryConfig, noCount = false) => {
if (!noCount && (config.groupBy && config.groupBy !== 'org' && config.groupBy !== 'repo')) {
return `'All' AS platform, ${getGroupArrayInsertAtClause(config, { key: 'repos' })}, ${getGroupArrayInsertAtClause(config, { key: 'orgs' })}, ${getGroupArrayInsertAtClause(config, { key: 'developers' })}`;
} else {
return 'platform, 1 AS repos, 1 AS orgs, 1 AS developers';
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const getRepoCommunityOpenrank = async (config: QueryConfig<RepoCommunity
const sql = `
SELECT
id,
${getTopLevelPlatform(config)},
${getTopLevelPlatform(config, true)},
argMax(name, time) AS name,
${getGroupArrayInsertAtClause(config, { key: 'openrank', noPrecision: true, defaultValue: '[]' })}
FROM
Expand Down

0 comments on commit 67ac97e

Please sign in to comment.