Fix: public booking page mixed both Filialen's barbers before any was picked
Test backoffice (smb-crm) / test (push) Successful in 1m37s
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:
@@ -142,7 +142,13 @@
|
|||||||
}
|
}
|
||||||
var visible = [];
|
var visible = [];
|
||||||
resourceOptionsEl.querySelectorAll('.opt').forEach(function (btn) {
|
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;
|
btn.hidden = !matches;
|
||||||
if (matches) {
|
if (matches) {
|
||||||
visible.push(btn);
|
visible.push(btn);
|
||||||
|
|||||||
Reference in New Issue
Block a user