我有一个自定义(编码)钩子,其工作原理如下:
\n\nmodule.exports = function registerHook({ action }, { services, exceptions }) {\n const { MailService, ItemsService } = services;\n const { ServiceUnavailableException, ForbiddenException } = exceptions;\n\n // Send mail to admin when event time is updated\n action(\'items.update\', async ({ keys, collection, payload }, { schema, accountability }) => {\n if (collection !== \'events\') return;\n if (\n !payload.time_get_in &&\n !payload.time_setup_start &&\n !payload.time_setup_end &&\n !payload.time_soundcheck_start &&\n !payload.time_soundcheck_end …Run Code Online (Sandbox Code Playgroud)