Skip to content

Commit

Permalink
#15 - Small URL change
Browse files Browse the repository at this point in the history
  • Loading branch information
JarneClauw committed Mar 11, 2024
1 parent 064f963 commit e7d3ba8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/project/endpoints/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def get(self, submission_id: int) -> dict[str, any]:
with db.session() as session:
submission = session.get(Submission, submission_id)
if submission is None:
data["url"] = urljoin(f"{API_HOST}/", "/submissions")
data["message"] = f"Submission (submission_id={submission_id}) not found"
return data, 404

Expand Down Expand Up @@ -197,6 +198,7 @@ def patch(self, submission_id:int) -> dict[str, any]:
# Get the submission
submission = session.get(Submission, submission_id)
if submission is None:
data["url"] = urljoin(f"{API_HOST}/", "/submissions")
data["message"] = f"Submission (submission_id={submission_id}) not found"
return data, 404

Expand Down Expand Up @@ -247,6 +249,7 @@ def delete(self, submission_id: int) -> dict[str, any]:
with db.session() as session:
submission = session.get(Submission, submission_id)
if submission is None:
data["url"] = urljoin(f"{API_HOST}/", "/submissions")
data["message"] = f"Submission (submission_id={submission_id}) not found"
return data, 404

Expand Down

0 comments on commit e7d3ba8

Please sign in to comment.