Compare commits
2 Commits
a825b3693b
...
refactor/s
| Author | SHA1 | Date | |
|---|---|---|---|
| dbfadf417a | |||
| dddb086cd8 |
@@ -14,7 +14,6 @@ import {
|
|||||||
CatalogItemDetail,
|
CatalogItemDetail,
|
||||||
CatalogVariantOptionsResponse,
|
CatalogVariantOptionsResponse,
|
||||||
CategoryItemsResponse,
|
CategoryItemsResponse,
|
||||||
Product,
|
|
||||||
} from './catalog.interface';
|
} from './catalog.interface';
|
||||||
|
|
||||||
type HttpParamValue = string | number | boolean | readonly (string | number | boolean)[];
|
type HttpParamValue = string | number | boolean | readonly (string | number | boolean)[];
|
||||||
@@ -33,12 +32,6 @@ export class CatalogService extends BaseApiService {
|
|||||||
return this.tenantService.getTenantApiUrl();
|
return this.tenantService.getTenantApiUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
getProductos(params?: ApiPaginationQueryParams): Observable<ApiPaginatedResponse<Product[]>> {
|
|
||||||
return this.http.get<ApiPaginatedResponse<Product[]>>(`${this.tenantApiUrl}/productos`, {
|
|
||||||
params: this.buildHttpParams(params),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getCatalog(): Observable<CatalogFeaturedGroup[]> {
|
getCatalog(): Observable<CatalogFeaturedGroup[]> {
|
||||||
return this.http.get<CatalogFeaturedGroup[]>(`${this.tenantApiUrl}/catalog`);
|
return this.http.get<CatalogFeaturedGroup[]>(`${this.tenantApiUrl}/catalog`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,23 +199,6 @@ export class CheckoutService extends BaseApiService {
|
|||||||
return purchase;
|
return purchase;
|
||||||
}
|
}
|
||||||
|
|
||||||
async completePurchase(tenantCode: string, purchaseId: number): Promise<PurchaseStatusResponse> {
|
|
||||||
const response = await firstValueFrom(
|
|
||||||
this.http.post<{ data?: PurchaseStatusResponse } | PurchaseStatusResponse>(
|
|
||||||
`${environment.url}tenants/${tenantCode}/compras/${purchaseId}/complete`,
|
|
||||||
{},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const purchase = this.extractResponseData<PurchaseStatusResponse>(response);
|
|
||||||
|
|
||||||
if (!purchase) {
|
|
||||||
throw new Error('Error al finalizar la compra.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return purchase;
|
|
||||||
}
|
|
||||||
|
|
||||||
async submitPurchaseForReview(
|
async submitPurchaseForReview(
|
||||||
tenantCode: string,
|
tenantCode: string,
|
||||||
purchaseId: number,
|
purchaseId: number,
|
||||||
|
|||||||
Reference in New Issue
Block a user