def get_author_detail(author_id): fetched = Author.query.get_or_404(author_id) author_schema = AuthorSchema() author = author_schema.dump(fetched) return response_with(resp.SUCCESS_200, value={"author": author})
def get_author_list(): fetched = Author.query.all() author_schema = AuthorSchema(many=True, only=['first_name', 'last_name', 'id']) authors = author_schema.dump(fetched) return response_with(resp.SUCCESS_200, value={"authors": authors})