Moving things to use the common_route_params and unified functions for SQL enable and SQL LIMIT OFFSET
This commit is contained in:
@@ -33,16 +33,18 @@ class Common_Route_Params:
|
||||
self,
|
||||
x_account_id: int,
|
||||
x_account_id_random: str,
|
||||
limit: int = 10,
|
||||
enabled: str = 'enabled',
|
||||
limit: int = 10,
|
||||
offset: int = 0,
|
||||
by_alias: bool = True,
|
||||
exclude_unset: bool = True,
|
||||
response = None,
|
||||
):
|
||||
self.x_account_id = x_account_id
|
||||
self.x_account_id_random = x_account_id_random
|
||||
self.limit = limit
|
||||
self.enabled = enabled
|
||||
self.limit = limit
|
||||
self.offset = offset
|
||||
self.by_alias = by_alias
|
||||
self.exclude_unset = exclude_unset
|
||||
self.response = response
|
||||
@@ -56,6 +58,7 @@ async def common_route_params(
|
||||
x_account_id: str = Header(..., min_length=11, max_length=22),
|
||||
enabled: str = 'enabled', # all, enabled, disabled
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
by_alias: bool = True,
|
||||
exclude_none: Optional[bool] = True,
|
||||
exclude_unset: bool = True,
|
||||
@@ -82,7 +85,7 @@ async def common_route_params(
|
||||
log.warning(f'The x-account-id Account ID was not found. Account ID: {x_account_id}')
|
||||
raise HTTPException(status_code=403, detail='The x-account-id Account ID was not found.') # Forbidden
|
||||
|
||||
commons = Common_Route_Params( x_account_id=x_account_id, x_account_id_random=x_account_id_random, limit=limit, enabled=enabled, by_alias=by_alias, exclude_unset=exclude_unset, response=response )
|
||||
commons = Common_Route_Params( x_account_id=x_account_id, x_account_id_random=x_account_id_random, limit=limit, offset=offset, enabled=enabled, by_alias=by_alias, exclude_unset=exclude_unset, response=response )
|
||||
|
||||
log.debug(commons)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user