add back button in edit pages (#96)
All checks were successful
Backend Deploy / build (push) Successful in 24s
Backend Build and Test / build (push) Successful in 3m2s

closes #89

Reviewed-on: #96
This commit was merged in pull request #96.
This commit is contained in:
2025-05-26 13:57:17 +02:00
parent 8fa4918743
commit 56a19acd0f
8 changed files with 36 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import { Location } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -31,7 +32,8 @@ export class EditAllowancePage implements OnInit {
private route: ActivatedRoute,
private formBuilder: FormBuilder,
private allowanceService: AllowanceService,
private router: Router
private router: Router,
private location: Location
) {
this.userId = this.route.snapshot.params['id'];
this.goalId = this.route.snapshot.params['goalId'];
@@ -98,4 +100,8 @@ export class EditAllowancePage implements OnInit {
this.allowanceService.deleteAllowance(this.goalId, this.userId);
this.router.navigate(['/tabs/allowance', this.userId]);
}
navigateBack() {
this.location.back();
}
}