Skip to content

Commit

Permalink
feat(UserService): Implementing scope_domain methods inside user service
Browse files Browse the repository at this point in the history
  • Loading branch information
gabszs committed May 20, 2024
1 parent e4c9768 commit 26706fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/services/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ async def add(self, user_schema: BaseUserWithPassword):
async def remove_by_id(self, id: Union[UUID, int], current_user: UserModel):
await self.validate_permission(id=id, current_user=current_user)
return await self._repository.delete_by_id(id)

async def patch(self, id: Union[UUID, int], schema, current_user: UserModel):
await self.validate_permission(id=id, current_user=current_user)
return await self._repository.update(id, schema)

async def patch_attr(self, id: Union[UUID, int], attr: str, value, current_user: UserModel):
await self.validate_permission(id=id, current_user=current_user)
return await self._repository.update_attr(id, attr, value)

0 comments on commit 26706fb

Please sign in to comment.