diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index 0661770..b51705e 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -97,14 +97,15 @@ class ReferentController extends Controller { public function setListOeuvres () { + $idListeOeuvre = Input::get('idListeOeuvre'); $idconcats = Input::get('oeuvres'); $list_oeuvres_id = explode("-", $idconcats); - + $ListeOeuvre = ListeOeuvre::find($idListeOeuvre); $ListeOeuvre->oeuvres()->detach(); $ListeOeuvre->oeuvres()->attach($list_oeuvres_id); - return Response::json(array('sucess' => 'true', )); + return Response::json(array()); } } diff --git a/SRC/public/js/ListeOeuvre.js b/SRC/public/js/ListeOeuvre.js index b548b52..60d533d 100644 --- a/SRC/public/js/ListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -28,16 +28,18 @@ $('.listeoeuvre').click(function() { //Enregistrement d'une liste d'ouevre $('#enregistrer').click(function() { - url = "/setListOeuvres/" + $(this).children('.idListeOeuvre').val(); - dataSend = { idListeOeuvre : 1, + url = "setListOeuvres"; + dataSend = { + _token : $('#_token').val(), + idListeOeuvre : "1", oeuvres : "1-2-3-4"}; $.post(url, dataSend, function( data ) { ; - }) + }, "json") .done(function() { - $("#oeuvrePic").append('