Skip to content

Commit aa43397

Browse files
Fix findOne to preserve undefined when record not found
Co-authored-by: xuyushun441-sys <[email protected]>
1 parent c0c7b53 commit aa43397

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/foundation/core/src/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export class ObjectRepository {
241241
const result = await this.getDriver().findOne(this.objectName, idOrQuery, hookCtx.query, this.getOptions());
242242

243243
// Evaluate formulas if result exists
244-
const resultWithFormulas = result ? this.evaluateFormulas(result) : null;
244+
const resultWithFormulas = result ? this.evaluateFormulas(result) : result;
245245

246246
hookCtx.result = resultWithFormulas;
247247
await this.app.triggerHook('afterFind', this.objectName, hookCtx);

0 commit comments

Comments
 (0)