#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.ts
file has been updated to correctly fetch and filter posts from Directus based on the environment.readItems
call now explicitly requests all the fields specified in thecodyops_post
data model:slug
,status
,sort
,user_created
,user_updated
,date_created
,date_updated
,title
,description
,tags
,cover_image
, andcontent
.DEV
mode (checked viaimport.meta.env.DEV
), posts with astatus
not equal to'archived'
will be retrieved.PROD
mode, only posts with astatus
equal to'published'
will be retrieved.Post
andDirectusSchema
) have been defined incore/src/types/codyops-post.ts
to provide proper type checking for the Directus SDK calls.