fix(portal): typecheck error in scheduling (TS18048)
ci / typecheck (map[dir:apps/portal name:portal]) (push) Has been cancelled
ci / typecheck (map[dir:apps/website name:website]) (push) Has been cancelled
ci / typecheck (map[dir:services/platform-api name:platform-api]) (push) Has been cancelled
ci / test (push) Has been cancelled
ci / typecheck (map[dir:apps/booking name:booking]) (push) Has been cancelled

timeToMin destructured [h, m] from t.split(':').map(Number); under
noUncheckedIndexedAccess those are number|undefined, so `h * 60` errored. Use
default-value destructuring ([h = 0, m = 0]). Surfaced now that the Gitea runner
actually runs the typecheck job (it never ran before).
This commit is contained in:
Ronni Baslund
2026-06-08 22:38:41 +02:00
parent b953be5fa2
commit b2cda6937c
+1 -1
View File
@@ -266,7 +266,7 @@ function addOverride() {
function removeOverride(idx: number) {
availForm.overrides.splice(idx, 1)
}
const timeToMin = (t: string) => { const [h, m] = t.split(':').map(Number); return h * 60 + m }
const timeToMin = (t: string) => { const [h = 0, m = 0] = t.split(':').map(Number); return h * 60 + m }
async function submitAvail() {
if (!selectedHostId.value) return
availBusy.value = true