Compare commits
2 Commits
10f2dc1faf
...
9b8171db5b
| Author | SHA1 | Date |
|---|---|---|
|
|
9b8171db5b | |
|
|
d38e4e0f69 |
|
|
@ -10,6 +10,7 @@ from __main__ import collection
|
||||||
from openapi_server.__main__ import collection
|
from openapi_server.__main__ import collection
|
||||||
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
|
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
def patchnotes_date_get(date): # noqa: E501
|
def patchnotes_date_get(date): # noqa: E501
|
||||||
"""patchnotes_date_get
|
"""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]]
|
:rtype: Union[List[PatchNotes], Tuple[List[PatchNotes], int], Tuple[List[PatchNotes], int, Dict[str, str]]
|
||||||
"""
|
"""
|
||||||
|
logging.error(type(date))
|
||||||
try:
|
try:
|
||||||
datetime.strptime(date, '%Y-%m-%d') # 2025-01-0
|
datetime.strptime(date, '%Y-%m-%d') # 2025-01-0
|
||||||
except ValueError as e:
|
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",
|
detail="The date is invalid. Needs to be in this Format YYYY-MM-DD",
|
||||||
status=400,
|
status=400,
|
||||||
)
|
)
|
||||||
|
logging.error('date:' + str(date))
|
||||||
query = {
|
query = {
|
||||||
'patch_date': {'$gte': date}
|
'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]]
|
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
||||||
"""
|
"""
|
||||||
deleted_doc = collection.delete_one({'patchID': patch_id})
|
deleted_doc = collection.delete_one({'patchID': patch_id})
|
||||||
|
logging.error(deleted_doc.deleted_count)
|
||||||
if deleted_doc.deleted_count == 0:
|
if deleted_doc.deleted_count == 0:
|
||||||
raise ProblemException(
|
raise ProblemException(
|
||||||
title="Not found",
|
title="Not found",
|
||||||
|
|
@ -105,6 +109,7 @@ def patchnotes_patch_idput(patch_id, body): # noqa: E501
|
||||||
detail="No document has been deleted",
|
detail="No document has been deleted",
|
||||||
status=404,
|
status=404,
|
||||||
)
|
)
|
||||||
|
logging.error(result)
|
||||||
return Response("Document was updated", status=200, mimetype='application/json')
|
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',
|
return Response(json_util.dumps(patch_note), mimetype='application/json',
|
||||||
status=200)
|
status=200)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def patchnotes_post(body):
|
def patchnotes_post(body):
|
||||||
"""patchnotes_post
|
"""patchnotes_post
|
||||||
|
|
||||||
|
|
@ -188,6 +185,7 @@ def patchnotes_post(body):
|
||||||
'patchID': str(uuid.uuid4()),
|
'patchID': str(uuid.uuid4()),
|
||||||
'title': pn.title,
|
'title': pn.title,
|
||||||
'changes': pn.changes,
|
'changes': pn.changes,
|
||||||
|
'version': pn.version,
|
||||||
'patch_date': date_str
|
'patch_date': date_str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue