async def populate_offer(self, *, offer: OfferInDB) -> OfferPublic: """ Queries the user linked to the offer and populates the offer with it. """ return OfferPublic( **offer.dict(), user=await self.users_repo.get_user_by_id(user_id=offer.user_id), # could populate cleaning here as well if needed )
async def populate_offer(self, *, offer: OfferInDB) -> OfferPublic: return OfferPublic( **offer.dict(), user=await self.users_repo.get_user_by_id(user_id=offer.user_id), # could populate cleaning here as well if needed )