zcash-grant-system/backend/grant/comment/views.py

15 lines
365 B
Python

from flask import Blueprint
from flask_yoloapi import endpoint
from .models import Comment, comments_schema
blueprint = Blueprint("comment", __name__, url_prefix="/api/v1/comment")
@blueprint.route("/", methods=["GET"])
@endpoint.api()
def get_comments():
all_comments = Comment.query.all()
result = comments_schema.dump(all_comments)
return result