From f781ad43f417d1879f794a3533aa5fb62238a62e Mon Sep 17 00:00:00 2001 From: Bangara Raju Kottedi Date: Sun, 28 Apr 2024 23:12:40 +0530 Subject: [PATCH] optimized api calls by moving api call to individual components and improved performance --- src/app/about/about.component.ts | 10 +++- src/app/blog/blog.component.ts | 10 +++- .../contact-sidebar.component.html | 2 +- .../contact-sidebar.component.scss | 3 + .../contact-sidebar.component.ts | 12 +++- src/app/contact/contact.component.ts | 7 +-- src/app/projects/projects.component.ts | 23 +++++--- src/app/resume/resume.component.ts | 10 +++- src/app/services/cv.service.ts | 54 +++++++++++++++++- src/assets/images/my-pic.png | Bin 0 -> 88760 bytes 10 files changed, 107 insertions(+), 24 deletions(-) create mode 100644 src/assets/images/my-pic.png diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index d157a46..bc6b7a8 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -14,6 +14,14 @@ export class AboutComponent extends BaseComponent implements OnInit { } ngOnInit(): void { - this.init(); + // this.init(); + this.getAbout(); + } + + getAbout(): void{ + this.svc.getHobbies(this.candidateId).subscribe((response: IAbout) => { + this.svc.about = this.svc.about ?? response; + this.assignData(response); + }); } } diff --git a/src/app/blog/blog.component.ts b/src/app/blog/blog.component.ts index 15d8b4d..103860c 100644 --- a/src/app/blog/blog.component.ts +++ b/src/app/blog/blog.component.ts @@ -16,6 +16,14 @@ export class BlogComponent extends BaseComponent implements OnInit{ } ngOnInit(): void { - this.init(); + // this.init(); + this.getBlog(); + } + + getBlog(){ + this.svc.getBlog(this.candidateId).subscribe((response: IBlog) => { + this.svc.blog = this.svc.blog ?? response; + this.assignData(response); + }); } } diff --git a/src/app/contact-sidebar/contact-sidebar.component.html b/src/app/contact-sidebar/contact-sidebar.component.html index 3f2e74f..f2ca587 100644 --- a/src/app/contact-sidebar/contact-sidebar.component.html +++ b/src/app/contact-sidebar/contact-sidebar.component.html @@ -3,7 +3,7 @@