🚀 ImportRunnerModal - working demo

ref #13
This commit is contained in:
Philipp Dormann 2021-01-20 17:46:18 +01:00
parent e34c91b2cc
commit 6b91b22713

View File

@ -58,15 +58,26 @@
}).showToast();
recent_processed = false;
const mapped = json_output.map(function (runner) {
let team = runner[`${$_("csv_import__team")}`];
if (runner["Klasse"]) {
team = runner["Klasse"];
}
return {
firstname: runner[`${$_("csv_import__firstname")}`],
middlename: runner[`${$_("csv_import__middlename")}`],
lastname: runner[`${$_("csv_import__lastname")}`],
team: runner[`${$_("csv_import__team")}`],
team: team,
};
});
console.log(mapped);
// ImportService.importControllerPostOrgsJson(1, mapped);
ImportService.importControllerPostOrgsJson(1, mapped)
.then((resp) => {
console.log("demo passed");
console.log(resp);
})
.catch((err) => {
console.log(err);
});
setTimeout(() => {
toast.hideToast();
recent_processed = true;
@ -181,7 +192,7 @@
{runner['Nachname']}
</td>
<td class="px-6 py-4 whitespace-nowrap">
{runner['Team'] || '---'}
{runner['Team'] ||runner['Klasse'] || '---'}
</td>
</tr>
{/if}