From 2515c8835b5b243ee508a68edad0cb53e46f765f Mon Sep 17 00:00:00 2001 From: mivanchenko Date: Sat, 12 Sep 2026 03:07:11 +0200 Subject: [PATCH] Fix: public booking page mixed both Filialen's barbers before any was picked applyLocationFilter()'s "!selectedLocation" check was meant to mean "only one Filiale exists, nothing to filter" but also fired in the multi-Filiale case before the customer had clicked one yet, showing every barber from every location mixed together in Mitarbeiter. Now keyed on LOCATIONS.length instead, so with 2+ Filialen nothing shows until one is actually selected. Co-Authored-By: Claude Sonnet 5 --- backoffice/app/templates/book.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backoffice/app/templates/book.html b/backoffice/app/templates/book.html index 4ab6529..e127fbb 100644 --- a/backoffice/app/templates/book.html +++ b/backoffice/app/templates/book.html @@ -142,7 +142,13 @@ } var visible = []; resourceOptionsEl.querySelectorAll('.opt').forEach(function (btn) { - var matches = !selectedLocation || btn.getAttribute('data-location-id') === selectedLocation; + // With a single Filiale (or none at all) there's nothing to filter + // by, same as before Filialen existed. With multiple, a barber only + // matches once its own Filiale is actually selected -- before that, + // nothing should show (mixing unrelated locations' staff together + // would be actively misleading, not just unfiltered). + var matches = LOCATIONS.length <= 1 + || (!!selectedLocation && btn.getAttribute('data-location-id') === selectedLocation); btn.hidden = !matches; if (matches) { visible.push(btn);