Skip to content

Commit

Permalink
fix fr
Browse files Browse the repository at this point in the history
  • Loading branch information
elver5041 committed Sep 24, 2024
1 parent 0f4ecef commit 9ead941
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/impl/Company/router_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from fastapi import APIRouter, Depends

from src.impl.Company.schema import CompanyCreate, CompanyGetByTier
from src.impl.Company.schema import CompanyCreate
from src.impl.Company.schema import CompanyGet
from src.impl.Company.schema import CompanyGetAll
from src.impl.Company.schema import CompanyUpdate
Expand Down Expand Up @@ -80,6 +80,6 @@ def get_events(companyId: int, token: BaseToken = Depends(JWTBearer())):
return company_service.get_company_events(companyId)


@router.get("/tier/{tier}", response_model=CompanyGetByTier)
@router.get("/tier/{tier}/", response_model=list[CompanyGet])
def get_by_tier(tier: int):
return company_service.get_by_tier(tier)
13 changes: 1 addition & 12 deletions src/impl/Company/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def tier_validator(cls, v):


class CompanyGet(BaseSchema):
id: int
name: str
description: str
website: str
Expand All @@ -35,18 +36,6 @@ class CompanyGet(BaseSchema):
telephone: str


class CompanyGetByTier(BaseSchema):
name: str
description: str
website: str
tier: int
image: Optional[str] = None
#is_image_url: Optional[bool] = None
address: str
linkdin: str
telephone: str


class CompanyGetAll(CompanyGet):
id: int

Expand Down
3 changes: 1 addition & 2 deletions src/impl/Company/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def get_company(self, companyId: int):
return self.get_by_id(companyId)

def get_by_tier(self, tier: int):
companies = db.session.query(Company).filter(Company.tier == tier)
return companies
return db.session.query(Company).filter(Company.tier == tier).all()

def add_company(self, payload: CompanyCreate, data: BaseToken):
if not data.check([UserType.LLEIDAHACKER]):
Expand Down

0 comments on commit 9ead941

Please sign in to comment.