Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
crisnicandrei committed Jul 17, 2023
1 parent 5e29904 commit be06693
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ export class ConfirmGiftDialogComponent {
this.dialogRef.close();
}

public onConfirmClick() {
public async onConfirmClick() {
let sub: Subscription;
try {
sub = this.giftResult.subscribe();
const res = await this.api.billing.giftStorage(this.email,0.1)
console.log(res);
} catch (e) {
this.msg.showError('Something went wrong! Please try again.');
console.log(e)
} finally {
sub.unsubscribe();
this.dialogRef?.close();
Expand Down
13 changes: 13 additions & 0 deletions src/app/shared/services/api/billing.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ export class BillingRepo extends BaseRepo {
BillingResponse
);
}

public giftStorage(recipientEmail,storageAmount) {
const data = {
recipientEmail,
storageAmount
};

return this.httpV2.post<BillingResponse>(
'/billing/giftStorage',
data,
BillingResponse
).toPromise()
}
}

export class BillingResponse extends BaseResponse {
Expand Down

0 comments on commit be06693

Please sign in to comment.