fix: handle both array and object responses in admin search

The CIMA search API returns {results: [...]} but the admin panel
was treating it as an array, causing CIMA products to be lost.

Now handles both formats:
- Array: [...]
- Object: {results: [...]}
This commit is contained in:
Antoni Nuñez Romeu
2026-07-16 16:32:24 +02:00
parent dca7e373cd
commit 26e7d92079
2 changed files with 30 additions and 3 deletions
+23
View File
@@ -28,6 +28,9 @@ jobs:
frontend-mobile:
- 'apps/frontend-mobile/**'
- 'packages/**'
parapharmacy-api:
- 'apps/parapharmacy-api/**'
- 'packages/**'
test-backend:
name: Backend Tests
@@ -85,3 +88,23 @@ jobs:
- name: Run Frontend Mobile Tests
run: npm test --workspace=frontend-mobile -- --ci
continue-on-error: true
test-parapharmacy-api:
name: Parapharmacy API Tests
needs: detect-changes
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install parapharmacy-api native deps
run: npm rebuild sqlite3 bcrypt --workspace=farma-clic-parapharmacy-api
- name: Run Parapharmacy API Tests
run: npm test --workspace=farma-clic-parapharmacy-api