Merge remote-tracking branch 'origin/main'
# Conflicts: # gen/openapi_server/controllers/patchnotes_controller.py
This commit is contained in:
commit
9b8171db5b
|
|
@ -10,6 +10,7 @@ from __main__ import collection
|
|||
from openapi_server.__main__ import collection
|
||||
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
|
||||
|
||||
|
||||
def patchnotes_date_get(date): # noqa: E501
|
||||
"""patchnotes_date_get
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ def patchnotes_date_get(date): # noqa: E501
|
|||
|
||||
:rtype: Union[List[PatchNotes], Tuple[List[PatchNotes], int], Tuple[List[PatchNotes], int, Dict[str, str]]
|
||||
"""
|
||||
logging.error(type(date))
|
||||
try:
|
||||
datetime.strptime(date, '%Y-%m-%d') # 2025-01-0
|
||||
except ValueError as e:
|
||||
|
|
@ -28,6 +30,7 @@ def patchnotes_date_get(date): # noqa: E501
|
|||
detail="The date is invalid. Needs to be in this Format YYYY-MM-DD",
|
||||
status=400,
|
||||
)
|
||||
logging.error('date:' + str(date))
|
||||
query = {
|
||||
'patch_date': {'$gte': date}
|
||||
}
|
||||
|
|
@ -54,6 +57,7 @@ def patchnotes_patch_iddelete(patch_id): # noqa: E501
|
|||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
||||
"""
|
||||
deleted_doc = collection.delete_one({'patchID': patch_id})
|
||||
logging.error(deleted_doc.deleted_count)
|
||||
if deleted_doc.deleted_count == 0:
|
||||
raise ProblemException(
|
||||
title="Not found",
|
||||
|
|
@ -105,6 +109,7 @@ def patchnotes_patch_idput(patch_id, body): # noqa: E501
|
|||
detail="No document has been deleted",
|
||||
status=404,
|
||||
)
|
||||
logging.error(result)
|
||||
return Response("Document was updated", status=200, mimetype='application/json')
|
||||
|
||||
|
||||
|
|
@ -152,14 +157,6 @@ def patchnotes_post(body):
|
|||
return Response(json_util.dumps(patch_note), mimetype='application/json',
|
||||
status=200)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def patchnotes_post(body):
|
||||
"""patchnotes_post
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue