def get_pending_posts(): try: pending = Post.get_pending() return jsonify(pending) except BaseException as e: print(e) abort(500)
def get_all_posts(): try: return jsonify({ 'pending': Post.get_pending(), 'rejected': Post.get_rejected(), 'approved': Post.get_approved(), }) except BaseException as e: print(e) abort(500)