feat: Add ability to change permissions on group creation API

This commit is contained in:
Timothy Jaeryang Baek 2025-01-17 12:03:24 -08:00
parent 2818f3cf95
commit 217e3a13c8

View File

@ -80,10 +80,10 @@ class GroupResponse(BaseModel):
class GroupForm(BaseModel): class GroupForm(BaseModel):
name: str name: str
description: str description: str
permissions: Optional[dict] = None
class GroupUpdateForm(GroupForm): class GroupUpdateForm(GroupForm):
permissions: Optional[dict] = None
user_ids: Optional[list[str]] = None user_ids: Optional[list[str]] = None
admin_ids: Optional[list[str]] = None admin_ids: Optional[list[str]] = None
@ -95,7 +95,7 @@ class GroupTable:
with get_db() as db: with get_db() as db:
group = GroupModel( group = GroupModel(
**{ **{
**form_data.model_dump(), **form_data.model_dump(exclude_none=True),
"id": str(uuid.uuid4()), "id": str(uuid.uuid4()),
"user_id": user_id, "user_id": user_id,
"created_at": int(time.time()), "created_at": int(time.time()),