|
|
|
@ -25,8 +25,8 @@ export class MerchandiseService {
|
|
|
|
|
constructor(private http: HttpClient) { }
|
|
|
|
|
|
|
|
|
|
findProducts(
|
|
|
|
|
filter = '', sortBy = 'id', sortOrder = 'desc',
|
|
|
|
|
pageNumber = 0, pageSize = 20): Observable<any> {
|
|
|
|
|
filter = '', sortBy = 'id', sortOrder = 'asc',
|
|
|
|
|
pageNumber = 0, pageSize = 5): Observable<any> {
|
|
|
|
|
|
|
|
|
|
return this.http.get('/teespring/api/products', {
|
|
|
|
|
observe: 'response',
|
|
|
|
@ -56,6 +56,7 @@ export class MerchandiseService {
|
|
|
|
|
|
|
|
|
|
return of([]);
|
|
|
|
|
}),
|
|
|
|
|
/* FIXME: preloading is not working
|
|
|
|
|
map(data => {
|
|
|
|
|
let urls = data.map(x => x.product.variants.map(v => [v.front_url, v.back_url]))
|
|
|
|
|
.reduce((acc, cur) => acc.concat(cur)).reduce((acc, cur) => acc.concat(cur));
|
|
|
|
@ -68,6 +69,7 @@ export class MerchandiseService {
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}),
|
|
|
|
|
*/
|
|
|
|
|
map(data => ({
|
|
|
|
|
products: data.map(x => x.product),
|
|
|
|
|
totalCount: data.length > 0 ? data[0].totalCount : 0
|
|
|
|
|