This commit is contained in:
Scott Idem
2021-12-17 16:17:17 -05:00
parent 398897efe1
commit 615d5dab17
6 changed files with 105 additions and 76 deletions

View File

@@ -18,6 +18,30 @@ from app.models.response_models import Resp_Body_Base, mk_resp
router = APIRouter()
@router.post('/membership/person/profile', response_model=Resp_Body_Base)
async def post_membership_person_profile_obj(
obj: Membership_Person_Profile_Base,
x_account_id: str = Header(...),
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())
obj_type = 'membership_person_profile'
obj_data_dict = obj.dict(by_alias=False, exclude_unset=True)
result = post_obj_template(
obj_type=obj_type,
data=obj_data_dict,
return_obj=True,
by_alias=True,
exclude_unset=True,
)
return result
@router.patch('/membership/person/profile/{obj_id}', response_model=Resp_Body_Base)
async def patch_membership_person_profile_obj(
obj_id: str = Query(..., min_length=1, max_length=22),