From 72229a9c3b5fe03bab01eab76539a9786240c266 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 27 Sep 2020 23:23:07 -0700 Subject: [PATCH] When adding/removing photos, respond with updated album json. --- .../etiquette_flask/backend/endpoints/album_endpoints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/backend/endpoints/album_endpoints.py b/frontends/etiquette_flask/backend/endpoints/album_endpoints.py index a7b05e7..ebda1e3 100644 --- a/frontends/etiquette_flask/backend/endpoints/album_endpoints.py +++ b/frontends/etiquette_flask/backend/endpoints/album_endpoints.py @@ -92,12 +92,12 @@ def post_album_add_photo(album_id): ''' Add a photo or photos to this album. ''' - response = {} album = common.P_album(album_id, response_type='json') photo_ids = etiquette.helpers.comma_space_split(request.form['photo_id']) photos = list(common.P_photos(photo_ids, response_type='json')) album.add_photos(photos, commit=True) + response = etiquette.jsonify.album(album) return jsonify.make_json_response(response) @site.route('/album//remove_photo', methods=['POST']) @@ -106,12 +106,12 @@ def post_album_remove_photo(album_id): ''' Remove a photo or photos from this album. ''' - response = {} album = common.P_album(album_id, response_type='json') photo_ids = etiquette.helpers.comma_space_split(request.form['photo_id']) photos = list(common.P_photos(photo_ids, response_type='json')) album.remove_photos(photos, commit=True) + response = etiquette.jsonify.album(album) return jsonify.make_json_response(response) # Album tag operations #############################################################################