mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 20:55:10 +01:00
Fixed API endpoint for single bookmark lookup
This commit is contained in:
15
digimarks.py
15
digimarks.py
@@ -618,12 +618,15 @@ def bookmarks_json(userkey, filtermethod=None, sortmethod=None):
|
|||||||
@app.route('/api/v1/<userkey>/<urlhash>')
|
@app.route('/api/v1/<userkey>/<urlhash>')
|
||||||
def bookmark_json(userkey, urlhash):
|
def bookmark_json(userkey, urlhash):
|
||||||
""" Serialise bookmark to json """
|
""" Serialise bookmark to json """
|
||||||
bookmark = Bookmark.select(
|
try:
|
||||||
Bookmark.url_hash == urlhash,
|
bookmark = Bookmark.get(
|
||||||
Bookmark.userkey == userkey,
|
Bookmark.url_hash == urlhash,
|
||||||
Bookmark.status == Bookmark.VISIBLE
|
Bookmark.userkey == userkey,
|
||||||
)[0]
|
Bookmark.status == Bookmark.VISIBLE
|
||||||
return jsonify(bookmark.to_dict())
|
)
|
||||||
|
return jsonify(bookmark.to_dict())
|
||||||
|
except Bookmark.DoesNotExist:
|
||||||
|
return jsonify({'message': 'Bookmark not found', 'status': 'error 404'})
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1/<userkey>/search/<filter_text>')
|
@app.route('/api/v1/<userkey>/search/<filter_text>')
|
||||||
|
|||||||
Reference in New Issue
Block a user