Some checks failed
The shared loyalty pins list factory has an autocomplete-from-team
flow gated behind config.staffApiPrefix (loaded once into a list, then
filtered client-side). The merchant entry in static/merchant/js/loyalty-pins.js
never set staffApiPrefix, so the loadStaffMembers branch never ran and
the "Staff member name" field on /merchants/loyalty/pins fell back to
free text instead of suggesting actual team members.
Wire the merchant config to /merchants/account, and add a flat
GET /merchants/account/team/members alias next to the existing
/merchants/account/team that returns just {members: [...]} — matching
the shape the shared autocomplete factory already expects at
${prefix}/team/members.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
685 B
JavaScript
20 lines
685 B
JavaScript
// app/modules/loyalty/static/merchant/js/loyalty-pins.js
|
|
// noqa: js-006 - async init pattern is safe, loadData has try/catch
|
|
|
|
const merchantPinsLog = window.LogConfig.loggers.merchantPins || window.LogConfig.createLogger('merchantPins');
|
|
|
|
function merchantLoyaltyPins() {
|
|
return loyaltyPinsList({
|
|
apiPrefix: '/merchants/loyalty',
|
|
staffApiPrefix: '/merchants/account',
|
|
showStoreFilter: true,
|
|
showCrud: true,
|
|
currentPage: 'pins',
|
|
});
|
|
}
|
|
|
|
if (!window.LogConfig.loggers.merchantPins) {
|
|
window.LogConfig.loggers.merchantPins = window.LogConfig.createLogger('merchantPins');
|
|
}
|
|
merchantPinsLog.info('Merchant loyalty pins module loaded');
|