diff options
author | benal01 <bja4245@rit.edu> | 2025-03-24 22:23:36 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-03-24 22:23:36 -0400 |
commit | f0ac1eda74367afc375112a7269c085a511ce490 (patch) | |
tree | 6c08eb12fb63f5ea6791b93ec3a7ac200d28f6ac /ufund-ui/src/app/components/cupboard/cupboard.component.ts | |
parent | 1c1d3922e7eea35764ebab39b18172ed2c8c82d9 (diff) | |
download | JellySolutions-f0ac1eda74367afc375112a7269c085a511ce490.tar.gz JellySolutions-f0ac1eda74367afc375112a7269c085a511ce490.tar.bz2 JellySolutions-f0ac1eda74367afc375112a7269c085a511ce490.zip |
viewing search results inside cupboard component
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index 646c4ff..e38f8c0 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -16,10 +16,9 @@ import { NeedListComponent } from '../need-list/need-list.component'; export class CupboardComponent implements OnInit { protected statusText = new BehaviorSubject("") - selectedForm = "create" + selectedForm = "create"; needs: any; - @ViewChild("needList") needList?: NeedListComponent - + @ViewChild("needList") needList?: NeedListComponent; constructor(private cupboardService: CupboardService, private usersService: UsersService) { } ngOnInit(): void { @@ -38,9 +37,32 @@ export class CupboardComponent implements OnInit { type: '' }; selectedNeedId: number | null = null; + searchResults: any[] = []; selectForm(name: string) { + //get search results from the need list + if (this.needList) { + this.searchResults = this.needList.searchResults; + } + console.log(this.searchResults) this.selectedForm = name; + if (name == 'update') { + if (this.searchResults) { + this.searchResults.forEach((element: any) => { + console.log(element) + }); + } + + } + } + + async updateSearchResults() { + if (this.needList) { + while (this.selectedForm == 'update') { + this.searchResults = this.needList.searchResults + await new Promise(resolve => setTimeout(resolve, 100)); + } + } } populateForm(need: any): void { |