removed many unneeded async definitions. The main controller remains async

This commit is contained in:
Lucas Jensen
2024-05-03 13:21:47 -07:00
parent 032feebe23
commit 5bb28ed923
15 changed files with 144 additions and 147 deletions

View File

@@ -11,8 +11,8 @@ class GroupController(BaseController):
super().__init__()
self.db: GroupQueries = group_queries
async def get_group(self) -> Group:
if (data := await self.db.select_one_by_id()) is None:
def get_group(self) -> Group:
if (data := self.db.select_one_by_id()) is None:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="Group not found"
)
@@ -24,12 +24,12 @@ class GroupController(BaseController):
detail=f"Error creating group object: {e}",
)
async def update_group_bio(self, bio: str) -> Group:
def update_group_bio(self, bio: str) -> Group:
try:
await self.db.update_group_bio(bio)
self.db.update_group_bio(bio)
except Exception as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"Error updating group bio: {e}",
)
return await self.get_group()
return self.get_group()