Notes/src/notes_history_api.py

22 lines
605 B
Python
Raw Normal View History

2017-09-20 22:30:11 -04:00
import base64
import math
import random
import string
import time
from flask import Blueprint, jsonify
from flask import request
from flask_login import login_required
from sql import delete
from sql import execute, insert, commit
from sql import getResults, getSingleResult
notes_history_api = Blueprint('notes_history_api', __name__)
@notes_history_api.route('/notes-history/<string:note_id>', methods = ['GET'])
@login_required
def getNoteHistory(note_id):
2017-09-21 22:20:10 -04:00
history = getResults("select * from notes_history where note_id = ? order by date_modified desc", [note_id])
2017-09-20 22:30:11 -04:00
return jsonify(history)