Skip to content

Commit

Permalink
update endpoiut route for planstates
Browse files Browse the repository at this point in the history
elsholz committed Jan 1, 2024
1 parent 220582c commit aea3131
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/code/metroplanner_api/metroplanner_api.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ async def custom_404_handler(request: Request, _):
request.path_params,
request.query_params,
)
return responses.gone_410()
raise responses.gone_410()


def lambda_handler(event, context):
2 changes: 1 addition & 1 deletion api/code/metroplanner_api/v1/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

from . import _planstates

router.include_router(_planstates.router, prefix="/_planstates", tags=["Private"])
router.include_router(_planstates.router, prefix="/_plans", tags=["Private"])

from . import _user

3 changes: 2 additions & 1 deletion api/code/metroplanner_api/v1/endpoints/_planstates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from fastapi import APIRouter, Request, HTTPException, Depends, Response
from datetime import datetime
from bson.objectid import ObjectId as BsonObjectId

from ... import type_definitions
from ... import responses
@@ -56,7 +57,7 @@ def post_planstate(
set_plan_data["numberOfLabels"] = planstate_data["numberOfLabels"]

db.plans.update_one(
{"_id": type_definitions.ObjectId(plan_id)},
{"_id": BsonObjectId(plan_id)},
{
"$push": {
"history": created_result.inserted_id,

0 comments on commit aea3131

Please sign in to comment.