Skip to content

Commit

Permalink
changing type counts to camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyweb committed Jan 22, 2021
1 parent 0ac5aaf commit 5568d69
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ class Config:
}


class TypeCount(APIModel):
type_id: int
type_name: str
type_count: int


class RequestType(APIModel):
type_id: int
type_name: str
Expand Down Expand Up @@ -188,3 +194,4 @@ class Config:
ClusterList = List[Cluster]
PinList = List[Pin]
PointList = List[Point]
TypeCountList = List[TypeCount]
4 changes: 2 additions & 2 deletions server/api/code/lacity_data_api/routers/councils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter

from ..models.schemas import CouncilList
from ..models.api_models import CouncilList, TypeCountList
from ..models.council import Council, get_open_request_counts

router = APIRouter()
Expand All @@ -19,7 +19,7 @@ async def get_council(id: int):


# TODO: add test
@router.get("/{id}/counts/open/types")
@router.get("/{id}/counts/open/types", response_model=TypeCountList)
async def get_council_open_requests(id: int):
result = await get_open_request_counts(id)
return result
Expand Down
2 changes: 1 addition & 1 deletion server/api/code/lacity_data_api/routers/regions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter

from ..models.schemas import RegionList
from ..models.api_models import RegionList
from ..models.region import Region

router = APIRouter()
Expand Down
2 changes: 1 addition & 1 deletion server/api/code/lacity_data_api/routers/request_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter

from ..models.schemas import RequestTypeList
from ..models.api_models import RequestTypeList
from ..models.request_type import RequestType

router = APIRouter()
Expand Down
6 changes: 3 additions & 3 deletions server/api/code/lacity_data_api/routers/service_requests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from sqlalchemy import sql
from fastapi import APIRouter

from ..models.schemas import (
ServiceRequestList, Filters, PinList
from ..models.api_models import (
ServiceRequestList, Filters, PinList, TypeCountList
)
from ..models.service_request import (
ServiceRequest, get_open_request_counts, get_open_requests, get_filtered_requests
Expand All @@ -23,7 +23,7 @@ async def get_all_service_requests(skip: int = 0, limit: int = 100):
return result


@router.get("/counts/open/types")
@router.get("/counts/open/types", response_model=TypeCountList)
async def get_open_request_counts_by_type():
result = await get_open_request_counts()
return result
Expand Down
2 changes: 1 addition & 1 deletion server/api/code/lacity_data_api/routers/shim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import APIRouter, status

from ..models.schemas import (
from ..models.api_models import (
Filter, Feedback, Comparison
)
from ..models import (
Expand Down
2 changes: 1 addition & 1 deletion server/api/code/lacity_data_api/routers/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from fastapi import APIRouter

from ..models.schemas import StatusTypes
from ..models.api_models import StatusTypes
from ..services import status, utilities
from ..config import GITHUB_CODE_VERSION, GITHUB_SHA, DEBUG, STAGE

Expand Down

0 comments on commit 5568d69

Please sign in to comment.