diff --git a/frontends/etiquette_flask/backend/endpoints/album_endpoints.py b/frontends/etiquette_flask/backend/endpoints/album_endpoints.py index 3b5c6ea..0d5fe43 100644 --- a/frontends/etiquette_flask/backend/endpoints/album_endpoints.py +++ b/frontends/etiquette_flask/backend/endpoints/album_endpoints.py @@ -78,6 +78,13 @@ def post_album_remove_child(album_id): response = album.jsonify() return jsonify.make_json_response(response) +@site.route('/album//remove_thumbnail_photo', methods=['POST']) +def post_album_remove_thumbnail_photo(album_id): + album = common.P_album(album_id, response_type='json') + album.set_thumbnail_photo(None) + common.P.commit(message='album remove thumbnail photo endpoint') + return jsonify.make_json_response(album.jsonify()) + @site.route('/album//refresh_directories', methods=['POST']) def post_album_refresh_directories(album_id): album = common.P_album(album_id, response_type='json') diff --git a/frontends/etiquette_flask/static/js/api.js b/frontends/etiquette_flask/static/js/api.js index 67fb213..5070cc5 100644 --- a/frontends/etiquette_flask/static/js/api.js +++ b/frontends/etiquette_flask/static/js/api.js @@ -100,6 +100,14 @@ function remove_photos(album_id, photo_ids, callback) api.albums._add_remove_photos(album_id, photo_ids, "remove", callback); } +api.albums.remove_thumbnail_photo = +function remove_thumbnail_photo(album_id, callback) +{ + const url = `/album/${album_id}/remove_thumbnail_photo`; + const data = new FormData(); + common.post(url, data, callback); +} + api.albums.set_thumbnail_photo = function set_thumbnail_photo(album_id, photo_id, callback) {