Fix: public booking page mixed both Filialen's barbers before any was picked
Test backoffice (smb-crm) / test (push) Successful in 1m37s

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 <noreply@anthropic.com>
This commit is contained in:
2026-09-12 03:07:11 +02:00
parent 456ca3872f
commit 2515c8835b
+7 -1
View File
@@ -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);