Skip to content

Commit

Permalink
fix user patch
Browse files Browse the repository at this point in the history
  • Loading branch information
elsholz committed Dec 29, 2023
1 parent ed5faee commit 009a4be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/code/metroplanner_api/type_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class PlanInDB(Plan):
class UpdateUser(BaseModel):
bio: LongText
display_name: ShortText
# public: bool
public: bool = True
profile_picture: Optional[str] = None


Expand Down
3 changes: 1 addition & 2 deletions api/code/metroplanner_api/v1/endpoints/_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,12 @@ def get_user(
raise responses.internal_server_error_500()


@router.get("", include_in_schema=False)
@router.patch("", include_in_schema=False)
@router.patch("/")
def patch_user(
user_data: type_definitions.UpdateUser, req: Request, sub: str = Depends(check_auth)
) -> type_definitions.UserInDB:
try:
# jsonschema.validate(instance=data, schema=request_schemas.patch_user_schema)
db = ENV.database
updated_result = db.users.find_one_and_update(
{
Expand Down

0 comments on commit 009a4be

Please sign in to comment.