diff --git a/app/services/user_service.py b/app/services/user_service.py index 3bd6a5a..702d0b1 100644 --- a/app/services/user_service.py +++ b/app/services/user_service.py @@ -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)