Improve the frontend modals

This commit is contained in:
Urtzi Alfaro
2025-10-27 16:33:26 +01:00
parent 61376b7a9f
commit 858d985c92
143 changed files with 9289 additions and 2306 deletions

View File

@@ -156,7 +156,8 @@ class BaseRepository(Generic[ModelType, CreateSchemaType, UpdateSchemaType]):
db: AsyncSession,
*,
obj_in: CreateSchemaType,
created_by: Optional[UUID] = None
created_by: Optional[UUID] = None,
tenant_id: Optional[UUID] = None
) -> ModelType:
"""Create a new record"""
try:
@@ -166,6 +167,10 @@ class BaseRepository(Generic[ModelType, CreateSchemaType, UpdateSchemaType]):
else:
obj_data = obj_in
# Add tenant_id if the model supports it and it's provided
if tenant_id and hasattr(self.model, 'tenant_id'):
obj_data['tenant_id'] = tenant_id
# Add created_by if the model supports it
if created_by and hasattr(self.model, 'created_by'):
obj_data['created_by'] = created_by
@@ -281,4 +286,4 @@ class BaseRepository(Generic[ModelType, CreateSchemaType, UpdateSchemaType]):
model=self.model.__name__,
id=str(id),
error=str(e))
raise
raise