Return 201 status from create_activity

This commit is contained in:
Jeremy Dormitzer 2018-08-25 09:31:03 -04:00
parent 7c7957b82b
commit 0a005c5e3d

View File

@ -34,8 +34,13 @@ function create_activity( $actor, $activity ) {
"actor" => $actor,
"activity" => $activity_json,
) );
return json_decode( $wpdb->get_var( sprintf(
$persisted = json_decode( $wpdb->get_var( sprintf(
"SELECT activity FROM activitypub_outbox WHERE id = %d", $wpdb->insert_id
) ) );
$response = new WP_REST_Response( $persisted );
$response->set_status( 201 );
// TODO set location header of response to created object URL
return $response;
}
}
?>