def delete_actor_by_id(payload, actor_id): queued_actor = Actors.query.filter(Actors.id == actor_id).one_or_none() if queued_actor is None: abort(404) else: Actors.delete(queued_actor) return jsonify({"success": True, "delete": actor_id})
def delete_actor(token, actor_id): try: actor = Actors.query.get(actor_id) Actors.delete(actor) return jsonify({'success': True, 'actor_id_deleted': actor_id}) except Exception: abort(404)