diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-04-04 20:56:02 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-04-04 20:56:02 -0400 |
commit | feba88fed855d1694d292e401a4cb336e0ff9d69 (patch) | |
tree | 4d5527043fbc80268ddd3754c588ceaa23403b62 /ufund-ui/src/app/components/need-page/need-page.component.ts | |
parent | 47a4326827a4123792e3a1165843344c8a9c7b0d (diff) | |
download | JellySolutions-feba88fed855d1694d292e401a4cb336e0ff9d69.tar.gz JellySolutions-feba88fed855d1694d292e401a4cb336e0ff9d69.tar.bz2 JellySolutions-feba88fed855d1694d292e401a4cb336e0ff9d69.zip |
Fix create-need dialog
Diffstat (limited to 'ufund-ui/src/app/components/need-page/need-page.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/need-page/need-page.component.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts index e9be093..1c6d8e4 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.ts +++ b/ufund-ui/src/app/components/need-page/need-page.component.ts @@ -1,5 +1,5 @@ -import {Component, Input} from '@angular/core'; -import {GoalType, Need} from '../../models/Need'; +import {Component, Input, OnInit} from '@angular/core'; +import {Need} from '../../models/Need'; import {ActivatedRoute, Router} from "@angular/router"; import {CupboardService} from "../../services/cupboard.service"; import {userType} from '../../models/User'; @@ -15,7 +15,7 @@ import {ModalService} from '../../services/modal.service'; templateUrl: './need-page.component.html', styleUrl: './need-page.component.css' }) -export class NeedPageComponent { +export class NeedPageComponent implements OnInit { constructor( private route: ActivatedRoute, private cupboardService: CupboardService, @@ -26,8 +26,6 @@ export class NeedPageComponent { protected modalService: ModalService ) {} - public GoalType = GoalType; - @Input() need!: Need; ngOnInit(): void { @@ -71,19 +69,15 @@ export class NeedPageComponent { delete(id : number) { this.cupboardService.deleteNeed(id) - .pipe(catchError((ex, r) => { + .pipe(catchError((ex, _) => { this.toastService.sendToast(ToastType.ERROR, ex.error) return of() })) .subscribe(() => { // this.needs = this.needs.filter(n => n.id !== id) this.toastService.sendToast(ToastType.INFO, "Need deleted") - this.router.navigate(['/']) + this.router.navigate(['/cupboard']) }) // this.refresh(); } - - edit(need: Need) { - - } } |