A lot of code clean up! Also adding in Response everywhere...
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, status
|
||||
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
|
||||
@@ -25,6 +25,7 @@ async def post_contact_obj(
|
||||
return_obj: Optional[bool] = True,
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -49,6 +50,7 @@ async def patch_contact_obj(
|
||||
return_obj: Optional[bool] = True,
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -81,6 +83,7 @@ async def patch_contact_json(
|
||||
exclude: Optional[list] = [],
|
||||
exclude_unset: Optional[bool] = True,
|
||||
exclude_none: Optional[bool] = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -115,6 +118,7 @@ async def get_contact_obj_li(
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: bool = True,
|
||||
exclude_unset: bool = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -157,7 +161,7 @@ async def get_contact_obj_li(
|
||||
return mk_resp(data=resp_data_li)
|
||||
else:
|
||||
log.debug(sql_result)
|
||||
return mk_resp(data=False, status_code=404)
|
||||
return mk_resp(data=False, status_code=404, response=response)
|
||||
|
||||
result = get_obj_li_template(
|
||||
obj_type=obj_type,
|
||||
@@ -175,6 +179,7 @@ async def get_contact_obj(
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -193,6 +198,7 @@ async def get_contact_obj(
|
||||
async def delete_contact_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
x_account_id: str = Header(...),
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -202,4 +208,4 @@ async def delete_contact_obj(
|
||||
obj_type=obj_type,
|
||||
obj_id=obj_id,
|
||||
)
|
||||
return result
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user