1
- import { apiStagingURL } from '../../constants/environment' ;
1
+ import { apiBaseURL } from '../../constants/environment' ;
2
2
3
3
export function getProductsService ( search , category ) {
4
4
var requestOptions = {
@@ -7,7 +7,7 @@ export function getProductsService(search, category) {
7
7
} ;
8
8
9
9
return new Promise ( ( resolve , reject ) => {
10
- fetch ( `${ apiStagingURL } /api?q=${ search || '' } &category=${ category || '' } ` , requestOptions )
10
+ fetch ( `${ apiBaseURL } /api?q=${ search || '' } &category=${ category || '' } ` , requestOptions )
11
11
. then ( ( response ) => response . json ( ) )
12
12
. then ( ( result ) => resolve ( result ) )
13
13
. catch ( ( error ) => reject ( error ) ) ;
@@ -21,7 +21,7 @@ export function getProductService(productId) {
21
21
} ;
22
22
23
23
return new Promise ( ( resolve , reject ) => {
24
- fetch ( `${ apiStagingURL } /api/product/${ productId } ` , requestOptions )
24
+ fetch ( `${ apiBaseURL } /api/product/${ productId } ` , requestOptions )
25
25
. then ( ( response ) => response . json ( ) )
26
26
. then ( ( result ) => resolve ( result ) )
27
27
. catch ( ( error ) => reject ( error ) ) ;
@@ -50,7 +50,7 @@ export function publishProductService(token, name, description, price, category,
50
50
} ;
51
51
52
52
return new Promise ( ( resolve , reject ) => {
53
- fetch ( `${ apiStagingURL } /api/seller/product/publish` , requestOptions )
53
+ fetch ( `${ apiBaseURL } /api/seller/product/publish` , requestOptions )
54
54
. then ( ( response ) => response . json ( ) )
55
55
. then ( ( result ) => resolve ( result ) )
56
56
. catch ( ( error ) => reject ( error ) ) ;
@@ -79,7 +79,7 @@ export function draftProductService(token, name, description, price, category, p
79
79
} ;
80
80
81
81
return new Promise ( ( resolve , reject ) => {
82
- fetch ( `${ apiStagingURL } /api/seller/product/preview` , requestOptions )
82
+ fetch ( `${ apiBaseURL } /api/seller/product/preview` , requestOptions )
83
83
. then ( ( response ) => response . json ( ) )
84
84
. then ( ( result ) => resolve ( result ) )
85
85
. catch ( ( error ) => reject ( error ) ) ;
@@ -97,7 +97,7 @@ export function getSellerProductsService(token) {
97
97
} ;
98
98
99
99
return new Promise ( ( resolve , reject ) => {
100
- fetch ( `${ apiStagingURL } /api/seller` , requestOptions )
100
+ fetch ( `${ apiBaseURL } /api/seller` , requestOptions )
101
101
. then ( ( response ) => response . json ( ) )
102
102
. then ( ( result ) => resolve ( result ) )
103
103
. catch ( ( error ) => reject ( error ) ) ;
@@ -115,7 +115,7 @@ export function getSellerProductService(token, productId) {
115
115
} ;
116
116
117
117
return new Promise ( ( resolve , reject ) => {
118
- fetch ( `${ apiStagingURL } /api/seller/product/${ productId } ` , requestOptions )
118
+ fetch ( `${ apiBaseURL } /api/seller/product/${ productId } ` , requestOptions )
119
119
. then ( ( response ) => response . json ( ) )
120
120
. then ( ( result ) => resolve ( result ) )
121
121
. catch ( ( error ) => reject ( error ) ) ;
@@ -141,7 +141,7 @@ export function updateProductService(token, productId, name, description, price,
141
141
} ;
142
142
143
143
return new Promise ( ( resolve , reject ) => {
144
- fetch ( `${ apiStagingURL } /api/seller/product/${ productId } ` , requestOptions )
144
+ fetch ( `${ apiBaseURL } /api/seller/product/${ productId } ` , requestOptions )
145
145
. then ( ( response ) => response . json ( ) )
146
146
. then ( ( result ) => resolve ( result ) )
147
147
. catch ( ( error ) => reject ( error ) ) ;
@@ -165,7 +165,7 @@ export function addProductimageService(token, product_pictures, productId) {
165
165
} ;
166
166
167
167
return new Promise ( ( resolve , reject ) => {
168
- fetch ( `${ apiStagingURL } /api/seller/product/image/${ productId } ` , requestOptions )
168
+ fetch ( `${ apiBaseURL } /api/seller/product/image/${ productId } ` , requestOptions )
169
169
. then ( ( response ) => response . json ( ) )
170
170
. then ( ( result ) => resolve ( result ) )
171
171
. catch ( ( error ) => reject ( error ) ) ;
@@ -182,7 +182,7 @@ export function deleteProductImageService(imageId) {
182
182
} ;
183
183
184
184
return new Promise ( ( resolve , reject ) => {
185
- fetch ( `${ apiStagingURL } /api/productImage/${ imageId } ` , requestOptions )
185
+ fetch ( `${ apiBaseURL } /api/productImage/${ imageId } ` , requestOptions )
186
186
. then ( ( response ) => response . json ( ) )
187
187
. then ( ( result ) => resolve ( result ) )
188
188
. catch ( ( error ) => reject ( error ) ) ;
@@ -203,7 +203,7 @@ export function updateStatusToPublishedService(token, productId) {
203
203
} ;
204
204
205
205
return new Promise ( ( resolve , reject ) => {
206
- fetch ( `${ apiStagingURL } /api/seller/product/publish/${ productId } ` , requestOptions )
206
+ fetch ( `${ apiBaseURL } /api/seller/product/publish/${ productId } ` , requestOptions )
207
207
. then ( ( response ) => response . json ( ) )
208
208
. then ( ( result ) => resolve ( result ) )
209
209
. catch ( ( error ) => reject ( error ) ) ;
@@ -226,7 +226,7 @@ export function bidProductService(token, productId, bidPrice) {
226
226
} ;
227
227
228
228
return new Promise ( ( resolve , reject ) => {
229
- fetch ( `${ apiStagingURL } /api/transaction/${ productId } ` , requestOptions )
229
+ fetch ( `${ apiBaseURL } /api/transaction/${ productId } ` , requestOptions )
230
230
. then ( ( response ) => response . json ( ) )
231
231
. then ( ( result ) => resolve ( result ) )
232
232
. catch ( ( error ) => reject ( error ) ) ;
@@ -244,7 +244,7 @@ export function getWishlistProductService(token) {
244
244
} ;
245
245
246
246
return new Promise ( ( resolve , reject ) => {
247
- fetch ( `${ apiStagingURL } /api/transaction/wishlist` , requestOptions )
247
+ fetch ( `${ apiBaseURL } /api/transaction/wishlist` , requestOptions )
248
248
. then ( ( response ) => response . json ( ) )
249
249
. then ( ( result ) => resolve ( result ) )
250
250
. catch ( ( error ) => reject ( error ) ) ;
0 commit comments