Skip to content

Commit

Permalink
fix: service exists should use exists from repository (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Oct 23, 2023
1 parent f40e497 commit 9d90210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion advanced_alchemy/service/_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def exists(self, *filters: FilterTypes | ColumnElement[bool], **kwargs: An
Returns:
Representation of instance with identifier `item_id`.
"""
return await self.repository.count(*filters, **kwargs) > 0
return await self.repository.exists(*filters, **kwargs)

async def get(
self,
Expand Down
2 changes: 1 addition & 1 deletion advanced_alchemy/service/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def exists(self, *filters: FilterTypes | ColumnElement[bool], **kwargs: Any) ->
Returns:
Representation of instance with identifier `item_id`.
"""
return self.repository.count(*filters, **kwargs) > 0
return self.repository.exists(*filters, **kwargs)

def get(
self,
Expand Down

0 comments on commit 9d90210

Please sign in to comment.