Skip to content
Discussion options

You must be logged in to vote

I think there's not, but I think you can use a beforeChange hook to check that:

hooks: {
   beforeChange: [
       ({ data, o operation }) => {
          if (operation !== 'create' && operation !== 'update') {
            return data;
          }
        
          // If status is changing set from `draft` to `published`
          if (originalDoc.status === 'draft' && data._status === 'published' ) {
               // do something
          }
          
          return data;
        }
   ]
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by r1tsuu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants