fix(prestashop): support customer note sorting in 1.1.9

This commit is contained in:
fatequod
2026-09-11 09:57:20 +02:00
parent 8230135a2e
commit 519f8daeb0
5 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core/prestashop",
"version": "1.1.8",
"version": "1.1.9",
"singleton": false,
"dependsOn": [
"core/orders",
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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}]`,
})));
+5
View File
@@ -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 => {