Skip to content

Commit 1e806f1

Browse files
author
Maxim Khailo
committed
The admin search view is no longer available. Use phoenix instead.
The admin search view should not have been available to search orders. This was abused in the storefronts to create the my orders pages. There was a bug in isaac that let this happen and now it has been fixed. So this search view is no longer available to customer JWTs. Unfortunately this will return a different payload than the search view. This requires fixing the storefronts.
1 parent a87a82a commit 1e806f1

2 files changed

Lines changed: 2 additions & 25 deletions

File tree

src/api/orders.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,14 @@
33

44
import * 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-
236
export 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

src/endpoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ export const account = '/v1/my/account';
5252
export 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';
5656
export const order = referenceNumber => `/v1/my/orders/${referenceNumber}`;

0 commit comments

Comments
 (0)