Replies: 7 comments
-
I agree, but I don't want to create a direct dependency on another plugin. I propose instead we add in hooks for when publish and unpublish are called. It will be left up to the user to implement. This will allow freedom to integrate with any plugin that allows access to it's APIs. The hooks will be something along the lines of publish before/after and unpublish before/after for the first version. Additional ones can be added as needed. For example for busting cache for REST cache on unpublish/publish would look have the following sample config. module.exports = ({ env }) => ({
publisher: {
enabled: true,
config:{
hooks:{
'publish:after': (entity, mode) => {
// Hit REST cache, cache bust code here
},
'unpublish:after': (entity, mode) => {
// Hit REST cache, cache bust code here
}
}
}
}
}); What do you think? |
Beta Was this translation helpful? Give feedback.
-
I like it :) and also it would be interesting to have a way to config it by model |
Beta Was this translation helpful? Give feedback.
-
Hi! I would like the validate check to run when content is published. But if I use a plugin to schedule delivery, the validate check doesn't run. Why not validate with a plugin? |
Beta Was this translation helpful? Give feedback.
-
@nogumaruo I am not fully understanding what you are asking. What validate check are you referring to? |
Beta Was this translation helpful? Give feedback.
-
@ComfortablyCoding However, in the case of a scheduled submission, there are no required validations, so I was wondering if the validations should be performed when a scheduled submission is set up. |
Beta Was this translation helpful? Give feedback.
-
I will need to check and see if any validations are being run separately when the publish button is pressed. I was not aware of this behaviour. This would not be something the hooks would cover. |
Beta Was this translation helpful? Give feedback.
-
Hopefully validation will be introduced into the plugin! |
Beta Was this translation helpful? Give feedback.
-
Hi!
Thanks for your plugin!
It would be significant enhancement to purge REST Cache (https://strapi-community.github.io/strapi-plugin-rest-cache/) on publish/unpublish
Beta Was this translation helpful? Give feedback.
All reactions