From 6132d64748dfc6806ed25f71d2e078a5ed29d071 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 27 Jun 2020 12:08:26 +0200 Subject: Process thumbnail synchronize page through Slim controllers --- assets/common/js/thumbnails-update.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'assets') diff --git a/assets/common/js/thumbnails-update.js b/assets/common/js/thumbnails-update.js index b37a32f3..3cd4c2a7 100644 --- a/assets/common/js/thumbnails-update.js +++ b/assets/common/js/thumbnails-update.js @@ -17,7 +17,7 @@ */ function updateThumb(basePath, ids, i, elements) { const xhr = new XMLHttpRequest(); - xhr.open('POST', `${basePath}/?do=ajax_thumb_update`); + xhr.open('PATCH', `${basePath}/admin/shaare/${ids[i]}/update-thumbnail`); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.responseType = 'json'; xhr.onload = () => { @@ -30,14 +30,14 @@ function updateThumb(basePath, ids, i, elements) { elements.current.innerHTML = i; elements.title.innerHTML = response.title; if (response.thumbnail !== false) { - elements.thumbnail.innerHTML = ``; + elements.thumbnail.innerHTML = ``; } if (i < ids.length) { updateThumb(basePath, ids, i, elements); } } }; - xhr.send(`id=${ids[i]}`); + xhr.send(); } (() => { -- cgit v1.2.3