news-catalyst / reproducible-tinynews-content-api

A webiny installation complete with scripted content models and graphql
0 stars 0 forks source link

Properly set the value of parent to the current ID in beforeCreate hook #57

Closed jacqui closed 3 years ago

jacqui commented 3 years ago

Issue #54

The parent field was being set to null because the id wasn't set yet. I referenced this webiny source file, the form model for a beforeCreate hook implementation that did this well.

Result is that the parent ID value is now set correctly on createArticle and createArticleFrom. This screenshot below shows that. It also shows that I need to do some work on the listArticles function as I don't think it should be returning all revisions of a single article, as also shown in the screenshot.

Screen Shot 2021-01-06 at 10 02 04 am