This commit is contained in:
Doar Mihai
2026-05-30 18:56:17 +03:00
parent 17a2211952
commit afc49488a9
5 changed files with 93 additions and 33 deletions
+3 -3
View File
@@ -56,7 +56,7 @@
<x-game-card :game="$entry->game" />
@auth
@if(auth()->id() === $list->user_id)
<button onclick="removeGameFromList({{ $list->id }}, {{ $entry->game->id }}, this)"
<button onclick="removeGameFromList('{{ $list->slug }}', '{{ $entry->game->slug }}', this)"
class="absolute top-2 right-2 w-6 h-6 bg-red-600 hover:bg-red-700 text-white rounded-full text-xs font-bold opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center leading-none">
×
</button>
@@ -71,9 +71,9 @@
@push('scripts')
<script>
function removeGameFromList(listId, gameId, btn) {
function removeGameFromList(listSlug, gameSlug, btn) {
if (!confirm('Remove from list?')) return;
fetch(`/lists/${listId}/games/${gameId}`, {
fetch(`/lists/${listSlug}/games/${gameSlug}`, {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,