Skip to content

Commit 7779b55

Browse files
committed
payload change
1 parent 273a7b8 commit 7779b55

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/views/stories.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,14 @@ def get_stories(poi_id):
176176
d = {'status': 'success', 'story_ids': arr}
177177
return jsonify(d)
178178

179-
@app.route('/stories/edit/multiple/<poi_id>', methods= ['POST'])
179+
@app.route('/stories/edit/multiple', methods= ['POST'])
180180
def edit_stories_with_poi(poi_id):
181181
try:
182-
poi = PointsOfInterest.query.get(poi_id)
182+
json_dict = json.loads(request.data)
183+
poi = PointsOfInterest.query.get(json_dict["poi_id"])
183184
if not poi:
184185
raise InvalidUsage('Error: ' + str(ex), status_code=404)
185-
json_dict = json.loads(request.data)
186+
186187
for story_id in json_dict["stories"]:
187188
story = StoryNames.query.get(story_id)
188189
if not story:

0 commit comments

Comments
 (0)