Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: OrderIdTypeEnum value "ORDER_NUMBER" renamed to "ORDER_KEY" #831

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions includes/type/enum/class-id-type-enums.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public static function register() {
[
'description' => __( 'The Type of Identifier used to fetch a single Order. Default is ID.', 'wp-graphql-woocommerce' ),
'values' => [
'id' => self::get_value( 'id' ),
'database_id' => self::get_value( 'database_id' ),
'order_number' => [
'name' => 'ORDER_NUMBER',
'value' => 'order_number',
'description' => __( 'Order number.', 'wp-graphql-woocommerce' ),
'id' => self::get_value( 'id' ),
'database_id' => self::get_value( 'database_id' ),
'order_key' => [
'name' => 'ORDER_KEY',
'value' => 'order_key',
'description' => __( 'Order key.', 'wp-graphql-woocommerce' ),
],
],
]
Expand Down
2 changes: 1 addition & 1 deletion includes/type/object/class-root-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public static function register_fields() {

$order_id = null;
switch ( $id_type ) {
case 'order_number':
case 'order_key':
$order_id = \wc_get_order_id_by_order_key( $id );
break;
case 'database_id':
Expand Down
4 changes: 2 additions & 2 deletions tests/wpunit/OrderQueriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ public function testOrderQueryAndIds() {
/**
* Assertion Three
*
* Tests "ORDER_NUMBER" ID type
* Tests "ORDER_KEY" ID type
*/
$variables = [
'id' => $this->factory->order->get_order_key( $order_id ),
'idType' => 'ORDER_NUMBER',
'idType' => 'ORDER_KEY',
];
$response = $this->graphql( compact( 'query', 'variables' ) );

Expand Down
Loading