File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ applications:
66 variables :
77 env :
88 NEXT_PUBLIC_API_ROUTE_PREFIX : ' api'
9- NEXT_PUBLIC_API_URL : ' https://upsun-deployment-config-3xlvpkq-kxux3rltbhsgo.fr-3.platformsh.site/api'
109 mounts :
1110 " /.npm " :
1211 source : " storage"
@@ -24,8 +23,8 @@ applications:
2423 printenv
2524 yarn
2625 yarn install --frozen-lockfile --network-timeout 120000
27- ls -ail node_modules
28- ls -ail pwa/node_modules
26+ patch -p1 < next-api-route.patch
27+ cat node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts
2928 yarn build
3029 deploy : |
3130 set -eux
Original file line number Diff line number Diff line change 1+ From 5b5d1f65e427540a819debcabd8f038be74f1f3e Mon Sep 17 00:00:00 2001
2+ From: Botis <botis@smile.fr>
3+ Date: Fri, 10 Jan 2025 17:15:03 +0100
4+ Subject: [PATCH] fix: api url not correctly built, empty NEXT_PUBLIC_API_URL
5+ or REACT_APP_API_URL was taken in account
6+
7+ ---
8+ node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts | 11 ++++++++---
9+ 1 file changed, 8 insertions(+), 3 deletions(-)
10+
11+ diff --git a/node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts b/node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts
12+ index a1ac2a1e..425a7bb2 100644
13+ --- a/node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts
14+ +++ b/node_modules/@elastic-suite/gally-admin-shared/src/constants/api.ts
15+ @@ -1,9 +1,14 @@
16+ let url =
17+ process.env.NODE_ENV === 'test'
18+ ? 'http://localhost/'
19+ - : process.env.NEXT_PUBLIC_API_URL ??
20+ - process.env.REACT_APP_API_URL ??
21+ - (typeof window !== 'undefined' ? window.location.origin : '')
22+ + : process.env.NEXT_PUBLIC_API_URL
23+ + ? process.env.NEXT_PUBLIC_API_URL
24+ + : process.env.REACT_APP_API_URL
25+ + ? process.env.REACT_APP_API_URL
26+ + : `${typeof window !== 'undefined' ? window.location.origin : ''}/${
27+ + process.env.NEXT_PUBLIC_API_ROUTE_PREFIX
28+ + }`
29+ +
30+ if (url && String(url).endsWith('/')) {
31+ url = url.slice(0, -1)
32+ }
You can’t perform that action at this time.
0 commit comments