mattmilburn/strapi-plugin-preview-button

[PLUGIN] before-build-url not called

Azcimas opened this issue · 1 comments

Hi there,

"@strapi/strapi": "4.10.6",
"strapi-plugin-preview-button": "1.1.3",

I followed your extending guide and created own plugin(both using only 3 files you have mentioned and then strapi-cli creator).
My bootstrap function is being called but callback in hook does not fire. Nor console.log nor an changes to state object are working.
Final url is as it is in config, no changes detected.

bootstrap(app) {
    console.log("hello"); // works
    app.registerHook( "plugin/preview-button/before-build-url", ( { state } ) => {
      console.log("hello 2"); // does not work
      const query = state?.query ?? {};

      return {
        state: {
          ...state,
          query: {
            ...query,
            example: "EXAMPLE",
          },
        },
      };
    });
  },

Working fine.