diff --git a/script.js b/script.js index 5c5cd0d..aa84e16 100644 --- a/script.js +++ b/script.js @@ -37,14 +37,17 @@ function importFiles(apiPath, formData) { const data = JSON.parse(xhr.responseText); if (data.error) { error(`Import Error: ${data.error}`); - } else { - success("Success!"); + } else if (data.length) { if (data.import && data.import.length) { + success("Success!"); success(`Imported IDs: ${data.import.join(', ')}`); } if (data.update && data.update.length) { + success("Success!"); success(`Updated IDs: ${data.update.join(', ')}`); } + } else { + error(`API Error: no response`); } } catch (e) { console.error(e);