def delete_movie_by_id(payload, movie_id): queued_movie = Movies.query.filter(Movies.id == movie_id).one_or_none() if queued_movie is None: abort(404) else: Movies.delete(queued_movie) return jsonify({"success": True, "delete": movie_id})
def delete_movie(token, movie_id): try: movie = Movies.query.get(movie_id) Movies.delete(movie) return jsonify({'success': True, 'movie_id_deleted': movie_id}) except Exception: abort(404)