feature/1-basic-scan-client #3

Merged
philipp merged 32 commits from feature/1-basic-scan-client into dev 2021-03-18 17:54:43 +00:00
Showing only changes of commit c930d87900 - Show all commits

View File

@ -67,21 +67,17 @@
headers: { Authorization: "Bearer " + $apikey },
data: { card, station: JSON.parse($stationinfo).id },
})
.then(function (response) {
console.log(response.data);
// ------------------------
console.log(card);
lastscan_totaldistance = "?m";
let time = new Date();
.then((response) => {
console.log(response.data.runner);
lastscan_totaldistance = response.data.runner.distance + "m";
const time = new Date();
const hours = (time.getHours() + "").padStart(2, "0");
const minutes = (time.getMinutes() + "").padStart(2, "0");
const seconds = (time.getSeconds() + "").padStart(2, "0");
lastscan_time = hours + ":" + minutes + ":" + seconds;
lastscan_laptime = response.data.lapTime + "s";
// ------------------------
})
.catch(function (e) {
console.log(e.response);
.catch((e) => {
lastscan_error = e.response.data.message;
});
}