1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 22:05:09 +01:00

Cleanup and better API endpoint

This commit is contained in:
2018-03-17 16:18:53 +01:00
parent 1e14163d42
commit cac31e40c9

View File

@@ -517,15 +517,9 @@ def bookmarks_json(userkey, filtermethod=None, sortmethod=None):
}
return jsonify(the_data)
#@app.route('/<userkey>/<urlhash>')
#def viewbookmark(userkey, urlhash):
# """ Bookmark detail view """
# bookmark = Bookmark.select(Bookmark.url_hash == urlhash, Bookmark.userkey == userkey)
# return render_template('viewbookmark.html', userkey=userkey, bookmark=bookmark)
@app.route('/<userkey>/<urlhash>/json')
def viewbookmarkjson(userkey, urlhash):
@app.route('/api/v1/<userkey>/<urlhash>')
def bookmark_json(userkey, urlhash):
""" Serialise bookmark to json """
bookmark = Bookmark.select(
Bookmark.url_hash == urlhash,