fix(prestashop): support customer note sorting in 1.1.9
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "core/prestashop",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"singleton": false,
|
||||
"dependsOn": [
|
||||
"core/orders",
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "core.prestashop",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "core.prestashop",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@orbito/api-lib": "^3.3.3",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "core.prestashop",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"description": "Integracja zamówień i płatności PrestaShop",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
+2
-2
@@ -340,7 +340,7 @@ module.exports = class PrestashopApi {
|
||||
const res = await this.makeRequest('messages', 'GET', {
|
||||
output_format: 'JSON',
|
||||
display: 'full',
|
||||
sort: 'date_add_ASC',
|
||||
sort: 'id_ASC',
|
||||
[`filter[${field}]`]: `[${id}]`,
|
||||
});
|
||||
const messages = Array.isArray(res?.messages) ? res.messages : [];
|
||||
@@ -368,7 +368,7 @@ module.exports = class PrestashopApi {
|
||||
.map(threadId => this.makeRequest('customer_messages', 'GET', {
|
||||
output_format: 'JSON',
|
||||
display: 'full',
|
||||
sort: 'date_add_ASC',
|
||||
sort: 'id_ASC',
|
||||
'filter[id_customer_thread]': `[${threadId}]`,
|
||||
})));
|
||||
|
||||
|
||||
@@ -162,6 +162,11 @@ test('collects public customer notes from order, cart and customer thread withou
|
||||
'Kod bramy: 1234',
|
||||
]);
|
||||
assert.equal(calls.filter(call => call.pathname.endsWith('/customer_messages')).length, 1);
|
||||
assert.equal(calls.filter(call => call.pathname.endsWith('/messages')).length, 2);
|
||||
for (const call of calls.filter(call => call.pathname.endsWith('/messages')
|
||||
|| call.pathname.endsWith('/customer_messages'))) {
|
||||
assert.equal(call.searchParams.get('sort'), 'id_ASC');
|
||||
}
|
||||
});
|
||||
|
||||
test('keeps notes from available sources when one customer-note endpoint is forbidden', async t => {
|
||||
|
||||
Reference in New Issue
Block a user