Skip to content

Commit

Permalink
fix: tweak Resource.findOne to return null if no record is found
Browse files Browse the repository at this point in the history
  • Loading branch information
yanascz authored and dziraf committed Jul 12, 2023
1 parent bd27164 commit 84e5e6a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class Resource extends BaseResource {
[idProperty.path()]: convertParam(idProperty, this.model.fields, id),
},
});
if (!result) return null;

return new BaseRecord(this.prepareReturnValues(result), this);
}
Expand Down

0 comments on commit 84e5e6a

Please sign in to comment.