mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-01-29 19:07:48 +01:00
Hotfix for wrong redirects on link deletion (#346)
This commit is contained in:
parent
9aff9e5fc4
commit
89f84c7340
@ -153,7 +153,8 @@ class LinkController extends Controller
|
||||
}
|
||||
|
||||
flash(trans('link.deleted_successfully'), 'warning');
|
||||
return redirect()->back();
|
||||
|
||||
return request()->has('redirect_back') ? redirect()->back() : redirect()->route('links.index');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,6 +143,6 @@ class ListController extends Controller
|
||||
}
|
||||
|
||||
flash(trans('list.deleted_successfully'), 'warning');
|
||||
return redirect()->back();
|
||||
return request()->has('redirect_back') ? redirect()->back() : redirect()->route('lists.index');
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class NoteController extends Controller
|
||||
*/
|
||||
public function destroy(Note $note): RedirectResponse
|
||||
{
|
||||
$linkId = $note->link->id;
|
||||
$link = $note->link;
|
||||
|
||||
$deletionSuccessful = NoteRepository::delete($note);
|
||||
|
||||
@ -86,6 +86,6 @@ class NoteController extends Controller
|
||||
}
|
||||
|
||||
flash(trans('note.deleted_successfully'), 'warning');
|
||||
return redirect()->route('links.show', [$linkId]);
|
||||
return redirect()->route('links.show', [$link]);
|
||||
}
|
||||
}
|
||||
|
@ -144,6 +144,7 @@ class TagController extends Controller
|
||||
}
|
||||
|
||||
flash(trans('tag.deleted_successfully'), 'warning');
|
||||
return redirect()->back();
|
||||
|
||||
return request()->has('redirect_back') ? redirect()->back() : redirect()->route('tags.index');
|
||||
}
|
||||
}
|
||||
|
@ -44,9 +44,10 @@
|
||||
</a>
|
||||
</div>
|
||||
<form id="link-delete-{{ $link->id }}" method="POST" style="display: none;"
|
||||
action="{{ route('links.destroy', [$link->id]) }}">
|
||||
action="{{ route('links.destroy', [$link]) }}">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="hidden" name="redirect_back" value="1">
|
||||
<input type="hidden" name="link_id" value="{{ $link->id }}">
|
||||
</form>
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user