Separate services - app, db, and job #1
|
@ -54,7 +54,9 @@ def create_token():
|
||||||
# API to get the token based on the id
|
# API to get the token based on the id
|
||||||
@app.route('/token/<id>', methods=['GET'])
|
@app.route('/token/<id>', methods=['GET'])
|
||||||
def get_token_by_id(id):
|
def get_token_by_id(id):
|
||||||
token = Token.query.get_or_404(id)
|
token = Token.query.get(id)
|
||||||
|
if not token:
|
||||||
|
return jsonify({'error': 'Token not found'}), 404
|
||||||
token_info = {
|
token_info = {
|
||||||
'id': token.id,
|
'id': token.id,
|
||||||
'email': token.email,
|
'email': token.email,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user