mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
+Image ordering
This commit is contained in:
@@ -373,9 +373,20 @@
|
||||
}
|
||||
const imagesComponent = document.querySelector("content-images");
|
||||
if (imagesComponent && typeof imagesComponent.getPendingFiles === "function") {
|
||||
imagesComponent.getPendingFiles().forEach((file) => {
|
||||
const pendingFiles = imagesComponent.getPendingFiles();
|
||||
const pendingIds = typeof imagesComponent.getPendingIds === "function" ? imagesComponent.getPendingIds() : [];
|
||||
const scanOrder = typeof imagesComponent.getScanOrder === "function" ? imagesComponent.getScanOrder() : [];
|
||||
pendingFiles.forEach((file, index) => {
|
||||
payload.append("scans", file);
|
||||
if (pendingIds[index]) {
|
||||
payload.append("scans_pending_ids[]", pendingIds[index]);
|
||||
}
|
||||
});
|
||||
if (Array.isArray(scanOrder) && scanOrder.length > 0) {
|
||||
scanOrder.forEach((token) => {
|
||||
payload.append("scans_order[]", token);
|
||||
});
|
||||
}
|
||||
if (typeof imagesComponent.getPendingDeletes === "function") {
|
||||
imagesComponent.getPendingDeletes().forEach((fileName) => {
|
||||
payload.append("scans_delete[]", fileName);
|
||||
|
||||
Reference in New Issue
Block a user