@@ -50,8 +50,27 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
function importAction() {
|
||||
if (recent_processed === true) {
|
||||
const toast = Toastify({
|
||||
text: "Runners are being imported...",
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
recent_processed = false;
|
||||
const mapped = json_output.map(function (runner) {
|
||||
return {
|
||||
firstname: runner[`${$_("csv_import__firstname")}`],
|
||||
middlename: runner[`${$_("csv_import__middlename")}`],
|
||||
lastname: runner[`${$_("csv_import__lastname")}`],
|
||||
team: runner[`${$_("csv_import__team")}`],
|
||||
};
|
||||
});
|
||||
reader.readAsText(files[0]);
|
||||
console.log(mapped);
|
||||
// ImportService.importControllerPostOrgsJson(1, mapped);
|
||||
setTimeout(() => {
|
||||
toast.hideToast();
|
||||
recent_processed = true;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -169,6 +188,12 @@
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
<button
|
||||
on:click={importAction}
|
||||
type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
|
||||
Läufer importieren
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
json_output = [];
|
||||
|
||||
Reference in New Issue
Block a user