Skip to content

Commit b710378

Browse files
Updates
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent ac33928 commit b710378

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/app/core/services/cla-contributor.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Injectable, isDevMode} from '@angular/core';
55
import {HttpClient} from '@angular/common/http';
66
import {Observable, Subject} from 'rxjs';
77
import {Project, ProjectModel} from '../models/project';
8-
import {UpdateUserModel, UserModel} from '../models/user';
8+
import {UpdateUserModel, UserModel, UserFromTokenModel} from '../models/user';
99
import {AlertService} from 'src/app/shared/services/alert.service';
1010
import {ActiveSignatureModel} from '../models/active-signature';
1111
import {IndividualRequestSignatureModel} from '../models/individual-request-signature';

src/app/shared/components/project-title/project-title.component.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Component, EventEmitter, Output, AfterViewInit } from '@angular/core';
55
import { AlertService } from '../../services/alert.service';
66
import { ClaContributorService } from 'src/app/core/services/cla-contributor.service';
77
import { ProjectModel } from 'src/app/core/models/project';
8-
import { UserModel } from 'src/app/core/models/user';
8+
import { UserModel, UserFromTokenModel } from 'src/app/core/models/user';
99
import { StorageService } from '../../services/storage.service';
1010
import { AppSettings } from 'src/app/config/app-settings';
1111

@@ -20,6 +20,7 @@ export class ProjectTitleComponent implements AfterViewInit {
2020

2121
project = new ProjectModel();
2222
user = new UserModel();
23+
userFromToken = new UserFromTokenModel();
2324

2425
constructor(
2526
private alertService: AlertService,
@@ -67,9 +68,11 @@ export class ProjectTitleComponent implements AfterViewInit {
6768
getUserFromToken() {
6869
this.claContributorService.getUserFromToken().subscribe(
6970
(response) => {
70-
this.user = response;
71-
this.storageService.setItem(AppSettings.USER_ID, this.user.userID);
72-
this.storageService.setItem(AppSettings.USER, this.user);
71+
this.userFromToken = response;
72+
this.storageService.setItem(AppSettings.USER_ID, this.userFromToken.userID);
73+
// If we need to store all details in USER then add a helper method to
74+
// copy data from UserFromTokenModel to UserModel
75+
// this.storageService.setItem(AppSettings.USER, convertToUserModel(this.userFromToken));
7376
},
7477
(exception) => {
7578
this.errorEmitter.emit(true);

0 commit comments

Comments
 (0)