feat: implement shopping cart and sales functionality with new component, service, and environment configuration.

This commit is contained in:
Luis Eduardo Estevao
2026-02-11 11:05:23 -03:00
parent 806ac42eae
commit c58290621a
3 changed files with 46 additions and 28 deletions

View File

@@ -28,7 +28,7 @@ export class ShoppingService {
constructor(
private httpClient: HttpClient,
private messageService: MessageService
) {}
) { }
getShoppingItems(idCart: string): Observable<ShoppingItem[]> {
if (idCart == null || idCart === '') {
@@ -72,7 +72,7 @@ export class ShoppingService {
updateShopping(shopping: Shopping) {
const resp = this.httpClient
.put<Shopping>(`${environment.url}shopping/${shopping.id}`, shopping)
.put<Shopping>(`${environment.url}shopping/cart`, shopping)
.pipe(
map((response) => {
console.log('Retorno atualização item: ' + response);
@@ -115,11 +115,11 @@ export class ShoppingService {
const url = `${environment.url}shopping/update/payment/${idCart}`;
console.log(
'Url: ' +
url +
' - cart: ' +
idCart +
' - payment: ' +
JSON.stringify(payment)
url +
' - cart: ' +
idCart +
' - payment: ' +
JSON.stringify(payment)
);
const resp = this.httpClient.put<ResultApi>(url, payment).pipe(
map((response) => {