diff --git a/packages/repository/src/repositories/kysely/strategyRegistry.repository.ts b/packages/repository/src/repositories/kysely/strategyRegistry.repository.ts index a251f42..2b1b011 100644 --- a/packages/repository/src/repositories/kysely/strategyRegistry.repository.ts +++ b/packages/repository/src/repositories/kysely/strategyRegistry.repository.ts @@ -37,16 +37,16 @@ export class KyselyStrategyRegistryRepository implements IStrategyRegistryReposi /** @inheritdoc */ async getStrategies(filters?: { handled?: boolean; chainId?: ChainId }): Promise { - const query = this.db.withSchema(this.schemaName).selectFrom("strategies"); + let query = this.db.withSchema(this.schemaName).selectFrom("strategies").selectAll(); if (filters?.chainId) { - query.where("chainId", "=", filters.chainId); + query = query.where("chainId", "=", filters.chainId); } - if (filters?.handled) { - query.where("handled", "=", filters.handled); + if (filters?.handled !== undefined && filters?.handled !== null) { + query = query.where("handled", "=", filters.handled); } - return query.selectAll().execute(); + return query.execute(); } }