Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Return full post object when deleting post - #1256

#1256
Merged
rmccue merged 3 commits into
developWP-API/WP-API:developfrom
1224-return-postWP-API/WP-API:1224-return-postCopy head branch name to clipboard
May 21, 2015
Merged

Return full post object when deleting post#1256
rmccue merged 3 commits into
developWP-API/WP-API:developfrom
1224-return-postWP-API/WP-API:1224-return-postCopy head branch name to clipboard

Conversation

@danielbachhuber

Copy link
Copy Markdown
Member

See #1224

@danielbachhuber

Copy link
Copy Markdown
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker

Copy link
Copy Markdown
Member

I would like @rmccue to weigh in here and in: #1255, #1254, and #1253

@rachelbaker

Copy link
Copy Markdown
Member

From the HTTP spec for DELETE:

A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity.

I don’t know what an entity describing the status means

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

$mock_request isn't really the right name, since this is a real request and "mock" has a specific meaning. $get_request?

@rmccue

rmccue commented May 19, 2015

Copy link
Copy Markdown
Member

This generally looks OK to me. One thing we might want to consider is wrapping the post in another object (e.g. { data: {...}, trashed: true, gone: false }) to make it clear that the request did succeed (since we're meant to be describing the status), buuuuut that might be overkill.

@rmccue

rmccue commented May 19, 2015

Copy link
Copy Markdown
Member

Also, should we consider this from #627?

if ( $new_status === 'trash' ) {
    // Send a 202 if it's only trashed to indicate that it will be
    // actually deleted later
    $response->set_status( 202 );

i.e. 200 = permanently deleted, 202 = trashed

Not sure we need the distinction now with the split from double-DELETE to separate trash/perma-delete, but worth thinking about.

@danielbachhuber

Copy link
Copy Markdown
Member Author

Not sure we need the distinction now with the split from double-DELETE to separate trash/perma-delete, but worth thinking about.

See #1260

rmccue added a commit that referenced this pull request May 21, 2015
Return full post object when deleting post
@rmccue
rmccue merged commit df7f00d into develop May 21, 2015
@rmccue
rmccue deleted the 1224-return-post branch May 21, 2015 01:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.