0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00

fix(core): allow empty condition in logs (#991)

This commit is contained in:
IceHe.xyz 2022-05-30 17:30:18 +08:00 committed by GitHub
parent b61f70fe01
commit 28198590fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ const buildLogConditionSql = (logCondition: LogCondition) =>
), ),
].filter(({ sql }) => sql); ].filter(({ sql }) => sql);
return sql`where ${sql.join(subConditions, sql` and `)}`; return subConditions.length > 0 ? sql`where ${sql.join(subConditions, sql` and `)}` : sql``;
}); });
export const countLogs = async (condition: LogCondition) => export const countLogs = async (condition: LogCondition) =>