Skip to content
This repository was archived by the owner on Jun 13, 2020. It is now read-only.

Commit 1685ecb

Browse files
authored
Merge pull request #12 from mythril-io/user-routing
Update user routing via username
2 parents dcd4998 + 6d97847 commit 1685ecb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/v1/users.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def get(self):
2929
users = User.query.all()
3030
return users_schema.dump(users)
3131

32-
@api.route('/<int:id>')
32+
@api.route('/<string:username>')
3333
class SingleUser(Resource):
34-
def get(self, id):
34+
def get(self, username):
3535
"""
36-
List User by id
36+
List User by username
3737
"""
38-
user = User.query.filter_by(id=id).first()
38+
user = User.query.filter_by(username=username).first()
3939
if user is None:
4040
return { 'message': 'User does not exist'}, 404
4141

0 commit comments

Comments
 (0)