Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Conversation

@danielbachhuber
Copy link
Member

See #1224

@danielbachhuber
Copy link
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker
Copy link
Member

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

@rachelbaker
Copy link
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
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
Copy link
Member

rmccue commented May 19, 2015

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
Copy link
Member

rmccue commented May 19, 2015

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
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.

4 participants