Replace window.location with the full URL to prevent passing query parameters

* Example before:
location + '/mark_as_solved'
/request_for_comments/30885?locale=de/mark_as_solved

Now: //localhost:3333/request_for_comments/30885/mark_as_solved

Note: https or http will be added automatically by browsers
This commit is contained in:
Sebastian Serth
2020-10-28 13:41:41 +01:00
parent eef48c47cd
commit 5d7d8a7f68
3 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
$(document).on('turbolinks:load', function() {
if ($.isController('error_templates')) {
$('#add-attribute').find('button').on('click', function () {
$.ajax(location + '/attribute.json', {
$.ajax('//' + location.host + location.pathname + '/attribute.json', {
method: 'POST',
data: {
_method: 'PUT',