Hi I am strugglin gwith API extensions, I am getting super confusing errors about ES / common js syntax.
All I need to do is make the simple example in the docs work:
export default ({ filter }, { exceptions }) => {
const { InvalidPayloadException } = exceptions;
filter('items.create', async (input) => {
if (LOGIC_TO_CANCEL_EVENT) {
throw new InvalidPayloadException(WHAT_IS_WRONG);
}
return input;
});
};