mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-03-16 18:16:31 +01:00
Profile creation part completed
This commit is contained in:
parent
f75e93e3eb
commit
f0a980b182
6 changed files with 21 additions and 29 deletions
|
|
@ -77,10 +77,12 @@
|
|||
<h2>Certifications</h2>
|
||||
<ul>
|
||||
<li *ngFor="let cert of userCertificates">
|
||||
<p><strong>Certificate Name:</strong> {{ cert.certificateName }}</p>
|
||||
<p><strong>Issuer:</strong> {{ cert.certificateIssuer }}</p>
|
||||
<p><strong>Year:</strong> {{ cert.certificateYear }}</p>
|
||||
<p><strong>Relevance:</strong> {{ cert.certificateRelevance }}</p>
|
||||
<p><strong>Certificate Name:</strong> {{ cert.name }}</p>
|
||||
<p><strong>Issuer:</strong> {{ cert.issuer }}</p>
|
||||
<p>
|
||||
<strong>Date:</strong> {{ cert.startDate }} - {{ cert.endDate }}
|
||||
</p>
|
||||
<p><strong>Relevance:</strong> {{ cert.description }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,10 +23,13 @@ export class ProfileComponent implements OnInit {
|
|||
this.route.queryParams.subscribe((params) => {
|
||||
const userId = params['userId']; // Get the userId from query params
|
||||
|
||||
console.log(userId);
|
||||
|
||||
if (userId) {
|
||||
this.userAPI.getUserDetails(userId).subscribe((response) => {
|
||||
if (response.success) {
|
||||
this.userDetails = response.data;
|
||||
console.log(this.userDetails)
|
||||
this.userExperiences = this.userDetails.experiences || [];
|
||||
this.userEducation = this.userDetails.education || [];
|
||||
this.userProjects = this.userDetails.projects || [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { Router, NavigationExtras } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { UserAPI } from '../../../service/api/user-api.service';
|
||||
|
||||
|
|
@ -99,26 +99,18 @@ export class StepperComponent implements OnInit {
|
|||
// Save personal details including professional summary
|
||||
const userDetailsResponse = await this.userAPI.saveUserDetails(personalDetailsWithSummary).toPromise();
|
||||
this.userId = userDetailsResponse.data.id;
|
||||
|
||||
console.log(this.userId)
|
||||
|
||||
// Save other details using the obtained user ID
|
||||
await Promise.all([
|
||||
this.userAPI.saveExperience(this.experience.value, this.userId).toPromise(),
|
||||
this.userAPI.saveEducation(this.education.value, this.userId).toPromise(),
|
||||
this.userAPI.saveProjects(this.project.value, this.userId).toPromise(),
|
||||
this.userAPI.saveSkills(this.skills.value, this.userId).toPromise(),
|
||||
this.userAPI.saveCertifications(this.certifications.value, this.userId).toPromise()
|
||||
]);
|
||||
await this.userAPI.saveExperience(this.experience.value, this.userId).toPromise();
|
||||
await this.userAPI.saveEducation(this.education.value, this.userId).toPromise();
|
||||
await this.userAPI.saveProjects(this.project.value, this.userId).toPromise();
|
||||
await this.userAPI.saveSkills(this.skills.value, this.userId).toPromise();
|
||||
await this.userAPI.saveCertifications(this.certifications.value, this.userId).toPromise();
|
||||
|
||||
|
||||
console.log("userID: ", this.userId)
|
||||
|
||||
// Navigate to the profile page
|
||||
const navigationExtras: NavigationExtras = {
|
||||
queryParams: { userId: this.userId }
|
||||
};
|
||||
this.router.navigateByUrl('/pages/layout/stepper/profile', navigationExtras);
|
||||
this.router.navigateByUrl(`/pages/layout/stepper/profile?userId=${this.userId}`);
|
||||
} catch (error) {
|
||||
console.error('Error occurred while saving user details:', error);
|
||||
// Handle error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue