diff options
Diffstat (limited to 'assets')
-rw-r--r-- | assets/common/js/thumbnails-update.js | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ | |||
17 | */ | 17 | */ |
18 | function updateThumb(basePath, ids, i, elements) { | 18 | function updateThumb(basePath, ids, i, elements) { |
19 | const xhr = new XMLHttpRequest(); | 19 | const xhr = new XMLHttpRequest(); |
20 | xhr.open('POST', `${basePath}/?do=ajax_thumb_update`); | 20 | xhr.open('PATCH', `${basePath}/admin/shaare/${ids[i]}/update-thumbnail`); |
21 | xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | 21 | xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); |
22 | xhr.responseType = 'json'; | 22 | xhr.responseType = 'json'; |
23 | xhr.onload = () => { | 23 | xhr.onload = () => { |
@@ -30,14 +30,14 @@ function updateThumb(basePath, ids, i, elements) { | |||
30 | elements.current.innerHTML = i; | 30 | elements.current.innerHTML = i; |
31 | elements.title.innerHTML = response.title; | 31 | elements.title.innerHTML = response.title; |
32 | if (response.thumbnail !== false) { | 32 | if (response.thumbnail !== false) { |
33 | elements.thumbnail.innerHTML = `<img src="${response.thumbnail}">`; | 33 | elements.thumbnail.innerHTML = `<img src="${basePath}/${response.thumbnail}">`; |
34 | } | 34 | } |
35 | if (i < ids.length) { | 35 | if (i < ids.length) { |
36 | updateThumb(basePath, ids, i, elements); | 36 | updateThumb(basePath, ids, i, elements); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | }; | 39 | }; |
40 | xhr.send(`id=${ids[i]}`); | 40 | xhr.send(); |
41 | } | 41 | } |
42 | 42 | ||
43 | (() => { | 43 | (() => { |