File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import * as endpoints from '../endpoints' ;
55
6- function buildQuery ( customerId ) {
7- return {
8- 'query' : {
9- 'nested' : {
10- 'path' : 'customer' ,
11- 'query' : {
12- 'term' : {
13- 'customer.id' : {
14- 'value' : customerId
15- }
16- }
17- }
18- }
19- }
20- }
21- }
22-
236export default class Orders {
247 constructor ( api ) {
258 this . api = api ;
269 }
2710
2811 // @method list(): Promise
2912 list ( ) {
30- const customerId = this . api . getCustomerId ( ) ;
31- if ( customerId != null ) {
32- const query = buildQuery ( customerId ) ;
33- return this . api . post ( endpoints . orders , query ) ;
34- } else {
35- return Promise . reject ( new Error ( 'api.orders.list: can\'t do request, please sign in first' ) ) ;
36- }
13+ return this . api . get ( endpoints . orders ) ;
3714 }
3815
3916 // @method get(referenceNumber: string): Promise
Original file line number Diff line number Diff line change @@ -52,5 +52,5 @@ export const account = '/v1/my/account';
5252export const changePassword = '/v1/my/account/change-password' ;
5353
5454// orders endpoints
55- export const orders = '/search/admin/orders_search_view/_search ' ;
55+ export const orders = '/v1/my/orders ' ;
5656export const order = referenceNumber => `/v1/my/orders/${ referenceNumber } ` ;
You can’t perform that action at this time.
0 commit comments