feat: update PrestashopService to use dynamic base URL from environment configuration

This commit is contained in:
Vincent Guillet
2025-11-22 21:48:44 +01:00
parent 3c700348df
commit 20573d73b3
3 changed files with 6 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import {forkJoin, map, of, switchMap, Observable, catchError} from 'rxjs';
import {PsItem} from '../interfaces/ps-item'; import {PsItem} from '../interfaces/ps-item';
import {PsProduct} from '../interfaces/ps-product'; import {PsProduct} from '../interfaces/ps-product';
import {ProductListItem} from '../interfaces/product-list-item'; import {ProductListItem} from '../interfaces/product-list-item';
import {environment} from '../../environments/environment';
type Resource = 'categories' | 'manufacturers' | 'suppliers'; type Resource = 'categories' | 'manufacturers' | 'suppliers';
@@ -36,7 +37,7 @@ const UPDATE_CFG: Record<Resource, {
@Injectable({providedIn: 'root'}) @Injectable({providedIn: 'root'})
export class PrestashopService { export class PrestashopService {
private readonly http = inject(HttpClient); private readonly http = inject(HttpClient);
private readonly base = '/ps'; private readonly base = environment.psUrl;
private readonly frontBase = 'https://shop.gameovergne.fr' private readonly frontBase = 'https://shop.gameovergne.fr'
// -------- Utils // -------- Utils

View File

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: true, production: true,
apiUrl: 'https://dev.unifihomenetwork.com/gameovergne-api/api' apiUrl: 'https://dev.unifihomenetwork.com/gameovergne-api/api',
psUrl: 'https://dev.unifihomenetwork.com/gameovergne-api/api/ps'
}; };

View File

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: false, production: false,
apiUrl: 'http://localhost:3000/api' apiUrl: 'http://localhost:3000/api',
psUrl: '/ps'
}; };