Skip to content

Commit dc0daef

Browse files
committed
addressing PR comments
1 parent 162b22e commit dc0daef

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/runtime/src/client/crud/operations/base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ export abstract class BaseOperationHandler<Schema extends SchemaDef> {
244244

245245
// clean up distinct utility fields
246246
for (const r of result) {
247-
for (const f of inMemoryDistinct) {
248-
delete r[`$distinct$${f}`];
249-
}
247+
Object.keys(r)
248+
.filter((k) => k.startsWith('$distinct$'))
249+
.forEach((k) => delete r[k]);
250250
}
251251
}
252252

packages/runtime/test/client-api/find.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ describe.each(createClientSpecs(PG_DB_NAME))('Client find tests for $provider',
282282

283283
// distinct with select
284284
r = await client.user.findMany({ distinct: ['role'], select: { email: true } });
285-
console.log(r);
286285
expect(r).toHaveLength(2);
287286
expect(r).toEqual(expect.arrayContaining([{ email: expect.any(String) }, { email: expect.any(String) }]));
288287

0 commit comments

Comments
 (0)