General clean up of everything.
This commit is contained in:
@@ -4,8 +4,8 @@ from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, stat
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
|
||||
from ..lib_general import *
|
||||
from ..log import *
|
||||
from ..lib_general import log, logging
|
||||
#from ..log import *
|
||||
from app.config import settings
|
||||
from app.db_sql import *
|
||||
|
||||
@@ -45,8 +45,8 @@ async def post_person_obj(
|
||||
|
||||
@router.patch('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def patch_person_obj(
|
||||
obj: Person_Base,
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
obj: Person_Base = None,
|
||||
x_account_id: Optional[str] = Header(..., ),
|
||||
return_obj: Optional[bool] = True,
|
||||
by_alias: Optional[bool] = True,
|
||||
@@ -92,12 +92,12 @@ async def get_person_obj_li(
|
||||
return result
|
||||
|
||||
|
||||
@router.get('/{obj_id}', response_model=Resp_Body_Base)
|
||||
@router.get('/{person_id}', response_model=Resp_Body_Base)
|
||||
async def get_person_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
person_id: str = Query(..., min_length=1, max_length=22),
|
||||
x_account_id: str = Header(...),
|
||||
inc_contact: bool = False,
|
||||
inc_address: bool = False,
|
||||
inc_contact: bool = False,
|
||||
inc_organization: bool = False,
|
||||
by_alias: Optional[bool] = True,
|
||||
exclude_unset: Optional[bool] = True,
|
||||
@@ -105,23 +105,14 @@ async def get_person_obj(
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
user_obj = load_person_obj(
|
||||
person_id=obj_id,
|
||||
person_obj = load_person_obj(
|
||||
person_id=person_id,
|
||||
inc_contact=inc_contact,
|
||||
inc_address=inc_address,
|
||||
inc_organization=inc_organization,
|
||||
).dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
data = user_obj
|
||||
return mk_resp(data=user_obj)
|
||||
|
||||
# obj_type = 'person'
|
||||
# result = get_obj_template(
|
||||
# obj_type=obj_type,
|
||||
# obj_id=obj_id,
|
||||
# by_alias=True,
|
||||
# exclude_unset=True,
|
||||
# )
|
||||
# return result
|
||||
data = person_obj
|
||||
return mk_resp(data=person_obj)
|
||||
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
|
||||
Reference in New Issue
Block a user