feat(back-end and front-end) email
Some checks failed
Build and Deploy / test-backend (push) Successful in 25s
Build and Deploy / test-frontend (push) Successful in 1m0s
Build and Deploy / build-and-push (push) Successful in 44s
Build and Deploy / deploy (push) Successful in 9s
PR Checks / prettier-autofix (pull_request) Failing after 10s
PR Checks / security-sast (pull_request) Successful in 31s
PR Checks / test-backend (pull_request) Successful in 25s
PR Checks / test-frontend (pull_request) Successful in 1m7s

This commit is contained in:
2026-03-04 15:12:28 +01:00
parent 6f47d02813
commit 2050ff35f4
5 changed files with 28 additions and 11 deletions

View File

@@ -163,12 +163,10 @@
</select>
<button
type="button"
(click)="confirmPayment()"
[disabled]="
confirmingPayment || selectedOrder.paymentStatus === 'COMPLETED'
"
(click)="updatePaymentMethod()"
[disabled]="confirmingPayment"
>
{{ confirmingPayment ? "Invio..." : "Conferma pagamento" }}
{{ confirmingPayment ? "Salvataggio..." : "Cambia metodo pagamento" }}
</button>
</div>
</div>

View File

@@ -132,14 +132,14 @@ export class AdminDashboardComponent implements OnInit {
});
}
confirmPayment(): void {
updatePaymentMethod(): void {
if (!this.selectedOrder || this.confirmingPayment) {
return;
}
this.confirmingPayment = true;
this.adminOrdersService
.confirmPayment(this.selectedOrder.id, this.selectedPaymentMethod)
.updatePaymentMethod(this.selectedOrder.id, this.selectedPaymentMethod)
.subscribe({
next: (updatedOrder) => {
this.confirmingPayment = false;
@@ -147,7 +147,7 @@ export class AdminDashboardComponent implements OnInit {
},
error: () => {
this.confirmingPayment = false;
this.errorMessage = 'Conferma pagamento non riuscita.';
this.errorMessage = 'Aggiornamento metodo pagamento non riuscito.';
},
});
}

View File

@@ -59,7 +59,7 @@ export class AdminOrdersService {
});
}
confirmPayment(orderId: string, method: string): Observable<AdminOrder> {
updatePaymentMethod(orderId: string, method: string): Observable<AdminOrder> {
return this.http.post<AdminOrder>(
`${this.baseUrl}/${orderId}/payments/confirm`,
{ method },