Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TT-407 problems solved
  • Loading branch information
mandres2015 committed Nov 26, 2021
commit c7c0966b9c668fe0a430a7f9fb0f954e5809b9b4
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from http import HTTPStatus

import azure.functions as func

Expand All @@ -20,7 +21,7 @@ def get_latest_entries(req: func.HttpRequest) -> func.HttpResponse:
if not owner_id:
return func.HttpResponse(
body="No owner id found",
status_code=404,
status_code=HTTPStatus.NOT_FOUND,
mimetype="application/json"
)

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

return func.HttpResponse(
body=json.dumps(time_entries, default=str),
status_code=200,
status_code=HTTPStatus.OK,
mimetype="application/json",
)

except ValueError:
return func.HttpResponse(
body=b"Invalid Format ID",
status_code=400,
status_code=HTTPStatus.BAD_REQUEST,
mimetype="application/json"
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import typing

from time_tracker.time_entries._domain import TimeEntry, TimeEntriesDao
import typing


class TimeEntryService:
Expand Down