feat: frontend send
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<!-- Note Field -->
|
||||
<div class="mb-4">
|
||||
<label class="form-label">Note (Optional)</label>
|
||||
<textarea class="form-control" rows="2" [(ngModel)]="note"></textarea>
|
||||
<textarea class="form-control" rows="2" [(ngModel)]="reference"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { APIService } from '../../services/api';
|
||||
|
||||
@Component({
|
||||
selector: 'app-screen-send',
|
||||
@@ -10,16 +11,27 @@ import { FormsModule } from '@angular/forms';
|
||||
export class ScreenSend {
|
||||
amount: number = 0;
|
||||
recipient: string = '';
|
||||
note: string = '';
|
||||
reference: string = '';
|
||||
|
||||
constructor(
|
||||
private api: APIService,
|
||||
){}
|
||||
|
||||
sendMoney() {
|
||||
console.log('Sending:', this.amount, 'to', this.recipient);
|
||||
// Add your logic here (e.g., API call)
|
||||
this.api.send(this.amount, this.recipient, this.reference).subscribe({
|
||||
next:()=> {
|
||||
this.cancel()
|
||||
//TODO show success message
|
||||
},
|
||||
error:()=> {
|
||||
//TODO show error message
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.amount = 0;
|
||||
this.recipient = '';
|
||||
this.note = '';
|
||||
this.reference = '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user