the middle of the idiots
This commit is contained in:
		@@ -6,9 +6,9 @@ from typing import List
 | 
			
		||||
from pydantic import BaseModel
 | 
			
		||||
from sqlalchemy.orm import Session
 | 
			
		||||
 | 
			
		||||
from ..database import SessionLocal
 | 
			
		||||
from ..models import Tenant
 | 
			
		||||
from ..config.settings import settings
 | 
			
		||||
from ...database import SessionLocal
 | 
			
		||||
from ...models import Tenant
 | 
			
		||||
from ...config.settings import settings
 | 
			
		||||
 | 
			
		||||
router = APIRouter()
 | 
			
		||||
 | 
			
		||||
@@ -17,6 +17,14 @@ class TenantCreate(BaseModel):
 | 
			
		||||
    name: str
 | 
			
		||||
    subdomain: str
 | 
			
		||||
 | 
			
		||||
    class Config:
 | 
			
		||||
        json_schema_extra = {
 | 
			
		||||
            "example": {
 | 
			
		||||
                "name": "Acme Corporation",
 | 
			
		||||
                "subdomain": "acme"
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
class TenantResponse(BaseModel):
 | 
			
		||||
    id: int
 | 
			
		||||
    name: str
 | 
			
		||||
@@ -25,6 +33,14 @@ class TenantResponse(BaseModel):
 | 
			
		||||
 | 
			
		||||
    class Config:
 | 
			
		||||
        from_attributes = True
 | 
			
		||||
        json_schema_extra = {
 | 
			
		||||
            "example": {
 | 
			
		||||
                "id": 1,
 | 
			
		||||
                "name": "Acme Corporation",
 | 
			
		||||
                "subdomain": "acme",
 | 
			
		||||
                "is_active": True
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@router.get("/", response_model=List[TenantResponse])
 | 
			
		||||
async def get_tenants(skip: int = 0, limit: int = 100, db: Session = Depends(SessionLocal)):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user