Skip to content

Commit 38162e7

Browse files
committed
fix: TT-407 problems solved
1 parent e0e7319 commit 38162e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

V2/time_tracker/time_entries/_application/_time_entries/_get_latest_entries.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from http import HTTPStatus
23

34
import azure.functions as func
45

@@ -20,7 +21,7 @@ def get_latest_entries(req: func.HttpRequest) -> func.HttpResponse:
2021
if not owner_id:
2122
return func.HttpResponse(
2223
body="No owner id found",
23-
status_code=404,
24+
status_code=HTTPStatus.NOT_FOUND,
2425
mimetype="application/json"
2526
)
2627

@@ -29,19 +30,19 @@ def get_latest_entries(req: func.HttpRequest) -> func.HttpResponse:
2930
if not time_entries or len(time_entries) == 0:
3031
return func.HttpResponse(
3132
body="No time entries found",
32-
status_code=404,
33+
status_code=HTTPStatus.NOT_FOUND,
3334
mimetype="application/json"
3435
)
3536

3637
return func.HttpResponse(
3738
body=json.dumps(time_entries, default=str),
38-
status_code=200,
39+
status_code=HTTPStatus.OK,
3940
mimetype="application/json",
4041
)
4142

4243
except ValueError:
4344
return func.HttpResponse(
4445
body=b"Invalid Format ID",
45-
status_code=400,
46+
status_code=HTTPStatus.BAD_REQUEST,
4647
mimetype="application/json"
4748
)

0 commit comments

Comments
 (0)