From c6a7bf91027482fa29a9ae4fd57b96544d71e022 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Thu, 13 Jun 2024 14:21:47 +0200 Subject: [PATCH] aa --- resources/views/mylinkspao.blade.php | 19 ++++++++++++------- routes/web.php | 4 +++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/resources/views/mylinkspao.blade.php b/resources/views/mylinkspao.blade.php index 1bbcdb8f..40f3971b 100644 --- a/resources/views/mylinkspao.blade.php +++ b/resources/views/mylinkspao.blade.php @@ -36,13 +36,14 @@

Links

- + +


- + @@ -59,18 +60,21 @@ buttons.forEach(button => button.addEventListener('click', handleButtonClick)); function handleButtonClick(event) { - const action = event.target.dataset.action; + let action = event.target.dataset.action; let id = '0'; try { id = form.querySelector('input[name="id"]').value; - } catch (e) { - id = 0; + if (!action) { + action = form.querySelector('input[name="action"]').value; + } + } catch (e) { + id = 0; } if (!id) { id = 0; } - + loading.style.display = 'block'; // Mostra la clessidra let baseUrl = window.location.href; @@ -85,4 +89,5 @@ } - + + \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index bc208124..b70b0bb1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6171,10 +6171,12 @@ Route::get('/paolibri', function () { Route::get('/mylinkspao', function (Illuminate\Http\Request $request) { try { $id = $request->query('id'); + $action = $request->query('action'); } catch (\Exception $e) { $id = ''; + $action = ''; } - return view('mylinkspao', ['id' => $id]); + return view('mylinkspao', ['id' => $id, 'action' => $action]); }); Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {