Fix issue where on page refresh when on function edit/new sub pages you would be redirected back to dashboard
This commit is contained in:
@@ -277,7 +277,7 @@
|
||||
<button
|
||||
class="bg-transparent hover:bg-red-500 text-red-700 font-semibold hover:text-white py-2 px-4 border border-red-500 hover:border-transparent rounded flex mr-2 items-center"
|
||||
hx-delete="{{ url_for('delete_http_function', name=name) }}" hx-target="#container" hx-swap="innerHTML"
|
||||
hx-confirm="Are you sure you want to delete {{ name }}?">
|
||||
hx-confirm="Are you sure you want to delete {{ name }}?" hx-push-url="true">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-4 h-4 mr-2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
@@ -306,10 +306,9 @@
|
||||
.then(response => response.json())
|
||||
.then(json => {
|
||||
if (name != updated_name) {
|
||||
htmx.ajax('GET', "{{ url_for('get_http_function_edit_form') }}", {
|
||||
htmx.ajax('GET', "{{ url_for('get_http_function_edit_form', function_id=function_id) }}", {
|
||||
target: '#container',
|
||||
swap: 'innerHTML',
|
||||
values: { name: updated_name }
|
||||
swap: 'innerHTML'
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user