Work on new API CRUD functions
This commit is contained in:
@@ -25,7 +25,9 @@ class Journal_Entry_Base(BaseModel):
|
|||||||
journal_id_random: Optional[str]
|
journal_id_random: Optional[str]
|
||||||
journal_id: Optional[int]
|
journal_id: Optional[int]
|
||||||
|
|
||||||
title: Optional[str]
|
code: Optional[str]
|
||||||
|
|
||||||
|
name: Optional[str]
|
||||||
summary: Optional[str]
|
summary: Optional[str]
|
||||||
content: Optional[str]
|
content: Optional[str]
|
||||||
|
|
||||||
@@ -39,6 +41,8 @@ class Journal_Entry_Base(BaseModel):
|
|||||||
archive_on: Optional[datetime.datetime]
|
archive_on: Optional[datetime.datetime]
|
||||||
archive: Optional[bool]
|
archive: Optional[bool]
|
||||||
|
|
||||||
|
data_json: Optional[Json]
|
||||||
|
|
||||||
enable: Optional[bool]
|
enable: Optional[bool]
|
||||||
hide: Optional[bool]
|
hide: Optional[bool]
|
||||||
priority: Optional[bool]
|
priority: Optional[bool]
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class Journal_Base(BaseModel):
|
|||||||
user_id_random: Optional[str]
|
user_id_random: Optional[str]
|
||||||
user_id: Optional[int]
|
user_id: Optional[int]
|
||||||
|
|
||||||
|
code: Optional[str]
|
||||||
|
|
||||||
default_private: Optional[bool]
|
default_private: Optional[bool]
|
||||||
default_public: Optional[bool]
|
default_public: Optional[bool]
|
||||||
default_personal: Optional[bool]
|
default_personal: Optional[bool]
|
||||||
@@ -39,7 +41,7 @@ class Journal_Base(BaseModel):
|
|||||||
private_passcode: Optional[str]
|
private_passcode: Optional[str]
|
||||||
public_passcode: Optional[str]
|
public_passcode: Optional[str]
|
||||||
|
|
||||||
title: Optional[str]
|
name: Optional[str]
|
||||||
summary: Optional[str]
|
summary: Optional[str]
|
||||||
|
|
||||||
enable: Optional[bool]
|
enable: Optional[bool]
|
||||||
|
|||||||
@@ -482,15 +482,15 @@ async def patch_obj(
|
|||||||
|
|
||||||
# ### BEGIN ### API CRUD ### post_obj() ###
|
# ### BEGIN ### API CRUD ### post_obj() ###
|
||||||
# Updated 2022-11-29
|
# Updated 2022-11-29
|
||||||
@router.post('/{obj_type_l1}/{obj_id}')
|
@router.post('/{obj_type_l1}')
|
||||||
@router.post('/{obj_type_l1}/{obj_type_l2}/{obj_id}')
|
@router.post('/{obj_type_l1}/{obj_type_l2}')
|
||||||
@router.post('/{obj_type_l1}/{obj_type_l2}/{obj_type_l3}/{obj_id}')
|
@router.post('/{obj_type_l1}/{obj_type_l2}/{obj_type_l3}')
|
||||||
async def post_obj(
|
async def post_obj(
|
||||||
crud: Api_Crud_Base,
|
crud: Api_Crud_Base,
|
||||||
obj_type_l1: Optional[str] = Query(..., max_length=50),
|
obj_type_l1: Optional[str] = Query(..., max_length=50),
|
||||||
obj_type_l2: str = None,
|
obj_type_l2: str = None,
|
||||||
obj_type_l3: str = None,
|
obj_type_l3: str = None,
|
||||||
obj_id: str = Query(..., min_length=11, max_length=22),
|
# obj_id: str = Query(..., min_length=11, max_length=22),
|
||||||
|
|
||||||
run_safety_check: bool = True,
|
run_safety_check: bool = True,
|
||||||
|
|
||||||
@@ -542,7 +542,7 @@ async def post_obj(
|
|||||||
debug_data['obj_type_l1'] = obj_type_l1
|
debug_data['obj_type_l1'] = obj_type_l1
|
||||||
debug_data['obj_type_l2'] = obj_type_l2
|
debug_data['obj_type_l2'] = obj_type_l2
|
||||||
debug_data['obj_type_l3'] = obj_type_l3
|
debug_data['obj_type_l3'] = obj_type_l3
|
||||||
debug_data['obj_id'] = obj_id
|
# debug_data['obj_id'] = obj_id
|
||||||
|
|
||||||
log.debug(debug_data)
|
log.debug(debug_data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user