11 lines
270 B
Python
11 lines
270 B
Python
|
from app import app
|
||
|
from models import Achievement
|
||
|
|
||
|
import json
|
||
|
|
||
|
@app.route("/achievement/<id>")
|
||
|
def get_achievement(id):
|
||
|
achievement = Achievement.query.filter_by(id=id).first()
|
||
|
if not achievement:
|
||
|
return "{}"
|
||
|
return json.dumps(achievement.to_obj())
|