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