diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index e6e0c30..279a7df 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -95,4 +95,9 @@ class ReferentController extends Controller { return redirect('/referent'); } + public function setListOeuvres () + { + return Response::json(array('sucess' => 'true', )) + } + } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 137d053..c363a82 100644 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -39,7 +39,7 @@ Route::group(['middleware' => 'auth'], function () Route::post('deleteListeOeuvre', 'ReferentController@deleteListeOeuvre'); Route::post('addListeOeuvre', 'ReferentController@addListeOeuvre'); Route::get('showListOeuvres/{id}', 'ReferentController@showListeOeuvres'); - Route::get('setListOeuvres', 'ReferentController@setListOeuvres'); + Route::post('setListOeuvres', 'ReferentController@setListOeuvres'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/public/js/getListeOeuvre.js b/SRC/public/js/ListeOeuvre.js similarity index 69% rename from SRC/public/js/getListeOeuvre.js rename to SRC/public/js/ListeOeuvre.js index 3b51a58..349046c 100644 --- a/SRC/public/js/getListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -1,6 +1,7 @@ $(document).ready( function() { console.log( "document loaded" ); $('.listeoeuvre').click(function() { + $('#oeuvrePic').empty(); url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); $.get(url, function( data ) { if (data.length == 0 ) @@ -14,7 +15,13 @@ $(document).ready( function() { }, "json" ) .fail(function() { - console.log( "error" ); + $("#oeuvrePic").append('