Skip to content

Conversation

@oguzkocer
Copy link
Contributor

Implement create /posts endpoint and integration tests that validate a post can be created from content, title or excerpt. If all these fields are missing, the server responds with empty_content error which is validated through an integration test.

The integration test backend now uses fields to retrieve all relevant fields from wp_cli and exposes it from wp-cli/post and wp-cli/posts endpoints.

Implements some of the missing contextual fields for SparsePost and its sub types.

@oguzkocer oguzkocer marked this pull request as ready for review September 9, 2024 18:34
@oguzkocer oguzkocer enabled auto-merge (squash) September 9, 2024 18:34

use crate::run_wp_cli_command;

const POST_FIELDS_ARG: &str = "--fields=ID, post_title, post_date, post_status, post_author, post_date_gmt, post_content, post_excerpt, comment_status, ping_status, post_password, post_modified, post_modified_gmt, guid, post_type";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the spaces in this argument. Having them doesn't impact this PR and I am removing them in the next PR, so it can be safely ignored.

@oguzkocer oguzkocer merged commit 34384ae into trunk Sep 11, 2024
4 checks passed
@oguzkocer oguzkocer deleted the posts-create branch September 11, 2024 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants