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 | |
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')
-rw-r--r-- | ufund-ui/src/app/components/need-page/need-page.component.html | 2 | ||||
-rw-r--r-- | ufund-ui/src/app/components/need-page/need-page.component.ts | 16 |
2 files changed, 6 insertions, 12 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.html b/ufund-ui/src/app/components/need-page/need-page.component.html index d494ccf..aed3e95 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.html +++ b/ufund-ui/src/app/components/need-page/need-page.component.html @@ -36,7 +36,7 @@ <span class="icon">add</span>Add To Basket </button> <ng-template #edit> - <app-need-edit *ngIf="need" [selectedNeed]="need"></app-need-edit> + <app-need-edit [mode]="'Edit'" *ngIf="need" [need]="need" (refreshNeedList)="ngOnInit()"></app-need-edit> </ng-template> <button *ngIf="isManager()" (click)="modalService.showModal(edit)"> <span class="icon">edit</span>Edit Need 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) { - - } } |