#7 - Added new Type definition and filter by status where we are on dev or prod #8
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "7-filter-blog-post-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
core/src/libs/posts.tsfile has been updated to correctly fetch and filter posts from Directus based on the environment.readItemscall now explicitly requests all the fields specified in thecodyops_postdata model:slug,status,sort,user_created,user_updated,date_created,date_updated,title,description,tags,cover_image, andcontent.DEVmode (checked viaimport.meta.env.DEV), posts with astatusnot equal to'archived'will be retrieved.PRODmode, only posts with astatusequal to'published'will be retrieved.PostandDirectusSchema) have been defined incore/src/types/codyops-post.tsto provide proper type checking for the Directus SDK calls.