diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3096bdc..7c6d99f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,6 +18,7 @@ import { DashboardModule } from './pages/dashboard/dashboard.module'; import { ApplianceRegistrationModule } from './pages/appliance-registration/appliance-registration.module'; import { AlertConfirmationModule } from './pages/components/alert-confirmation/alert-confirmation.module'; import { ProductModule } from './pages/product/product.module'; +import { ModalProductModule } from './pages/components/modal-product/modal-product.module'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); diff --git a/src/app/models/product.ts b/src/app/models/product.ts index e4a59e7..c041999 100644 --- a/src/app/models/product.ts +++ b/src/app/models/product.ts @@ -1,17 +1,22 @@ -export interface ServiceRequest { - user_id: number; - first_name: string; - last_name: string; - email: string; - phone_number: string; +export interface Product { + id: number; appliance_type: string; + application_date: string; brand: string; + collection_address: string; + created_at: string; + damaged_appliance_image: string; + preferred_contact_method: string; problem_details: string; - address: string; service_type: string; - preferred_contact_method: string; - damaged_appliance_image: string; - state: string; - application_date: string; + updated_at: string; + user: { + id: number; + first_name: string; + last_name: string; + email: string; + phone_number: string; + address: string; + }; } diff --git a/src/app/pages/components/alert-confirmation/alert-confirmation.component.ts b/src/app/pages/components/alert-confirmation/alert-confirmation.component.ts index 97d02ef..7b967ad 100644 --- a/src/app/pages/components/alert-confirmation/alert-confirmation.component.ts +++ b/src/app/pages/components/alert-confirmation/alert-confirmation.component.ts @@ -1,4 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'app-alert-confirmation', @@ -6,10 +7,21 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; styleUrls: ['./alert-confirmation.component.css'], }) export class AlertConfirmationComponent { - @Output() alertClosed = new EventEmitter(); - isOpen = true; + private userId?: number; - closeAlert() { - this.alertClosed.emit(); + constructor( + private activatedRoute: ActivatedRoute, + private router: Router + ) { + const userId = this.activatedRoute.snapshot.paramMap.get('userId'); + if (userId) { + this.userId = +userId; + } + } + + closeAlert(): void { + if (this.userId) { + this.router.navigate(['/pages', this.userId, 'product']); + } } } diff --git a/src/app/pages/components/menu/menu.component.html b/src/app/pages/components/menu/menu.component.html index 0df96f7..d6975a7 100644 --- a/src/app/pages/components/menu/menu.component.html +++ b/src/app/pages/components/menu/menu.component.html @@ -1,7 +1,7 @@