Skip to content
Open
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
34 changes: 34 additions & 0 deletions app/api/resources/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,37 @@ def get(cls, user_id):
if not is_wrong_token:
return http_response_checker(get_request(f"/users/{user_id}", token, params=None))
return is_wrong_token

@users_ns.route("mentorship_relations")
@users_ns.param(
name="relation_state",
description="Mentorship relation state filter.",
_in="query",
)
class GetAllMyMentorshipRelation(Resource):
@classmethod
@users_ns.doc("get_all_user_mentorship_relations")
@users_ns.expect(auth_header_parser)
@users_ns.response(
HTTPStatus.OK,
"Return all user's mentorship relations, filtered by the relation state, was successfully.",
public_user_personal_details_response_model,
)
@users_ns.response(
HTTPStatus.UNAUTHORIZED,
f"{messages.TOKEN_HAS_EXPIRED}\n"
f"{messages.TOKEN_IS_INVALID}\n"
f"{messages.AUTHORISATION_TOKEN_IS_MISSING}"
)
@users_ns.response(
HTTPStatus.INTERNAL_SERVER_ERROR, f"{messages.INTERNAL_SERVER_ERROR}"
)
def get(cls):

token = request.headers.environ["HTTP_AUTHORIZATION"]
search = request.args.get("search", "")
page = request.args.get("page", default=DEFAULT_PAGE, type=int)
per_page = request.args.get("per_page", default=DEFAULT_USERS_PER_PAGE, type=int)


return http_response_checker(get_request("/users/verified", token))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this retuning verified users and not mentorship rrelations the login user?