feat: update PrestashopService to use dynamic base URL from environment configuration
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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'
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user