From 122a7c529cedc4bd790e99fa39cf614d7783b7ef Mon Sep 17 00:00:00 2001 From: Gustavo Cunha Date: Mon, 18 Nov 2024 12:01:13 +0100 Subject: [PATCH] FIX: Sorting broke after devise removal due to missing csrf --- app/javascript/admin/components/sortable.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/javascript/admin/components/sortable.js b/app/javascript/admin/components/sortable.js index 6d51e051..5a553611 100644 --- a/app/javascript/admin/components/sortable.js +++ b/app/javascript/admin/components/sortable.js @@ -8,7 +8,6 @@ const sort = (selector) => { } const model = element.dataset.model const url = element.dataset.url - const csrf = document.querySelector('[name~=csrf-token]').content const sortable = Sortable.create(element, { onSort: () => { const data = { @@ -20,7 +19,6 @@ const sort = (selector) => { fetch(url, { method: 'PUT', headers: { - 'X-CSRF-Token': csrf, 'Content-Type': 'application/json' }, body: JSON.stringify(data)