From 4186983da13740ec0a4731770ac238922631be11 Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 31 Mar 2025 22:52:49 -0400 Subject: auto refresh with emitter --- ufund-ui/src/app/components/need-edit/need-edit.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ufund-ui/src/app/components/need-edit/need-edit.component.ts') diff --git a/ufund-ui/src/app/components/need-edit/need-edit.component.ts b/ufund-ui/src/app/components/need-edit/need-edit.component.ts index 02ffb71..2462534 100644 --- a/ufund-ui/src/app/components/need-edit/need-edit.component.ts +++ b/ufund-ui/src/app/components/need-edit/need-edit.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output } from '@angular/core'; +import { Component, Input, Output, EventEmitter } from '@angular/core'; import { Need, GoalType } from '../../models/Need'; import { CupboardService } from '../../services/cupboard.service'; import { catchError, of } from 'rxjs'; @@ -18,7 +18,7 @@ export class NeedEditComponent { ) {} @Input() selectedNeed!: Need; - @Output() selectedNeedID: number | null = null; + @Output() refreshNeedList = new EventEmitter(); update(form: any) { console.log(form); @@ -50,7 +50,7 @@ export class NeedEditComponent { (result) => { if (result) { console.log("need updated successfully"); - // this.needList?.refresh() + this.refreshNeedList.emit(); } else { console.log("need update failed"); } -- cgit v1.2.3