@unchainedshop/plugins
Version:
Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec
31 lines (24 loc) • 730 B
text/typescript
import { IFilterAdapter, FilterDirector, FilterAdapter } from '@unchainedshop/core';
const StrictQualFilter: IFilterAdapter = {
...FilterAdapter,
key: 'shop.unchained.filters.strict-qual',
label: 'Simple Strict Equal DB Filter',
version: '1.0.0',
orderIndex: 0,
actions: (params) => {
return {
...FilterAdapter.actions(params),
transformProductSelector: async (lastSelector, options) => {
const { key, value } = options || {};
if (key) {
return {
...lastSelector,
[]: value !== undefined ? value : { $exists: true },
};
}
return lastSelector;
},
};
},
};
FilterDirector.registerAdapter(StrictQualFilter);