Skip to content

Commit

Permalink
refactor(list-item): delete member
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijeinath committed Sep 20, 2022
1 parent cd87150 commit ff8b5a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Expand Up @@ -98,9 +98,6 @@ export class ListItemFormComponent implements OnInit {
sysAdmin = false;
projectAdmin = false;

// project data
project: ReadProject;

loading: boolean;

initComponent: boolean;
Expand All @@ -127,10 +124,9 @@ export class ListItemFormComponent implements OnInit {
// get the project data from cache
this._cache.get(this.projectCode).subscribe(
(response: ReadProject) => {
this.project = response;

// is logged-in user projectAdmin?
this.projectAdmin = this.sysAdmin ? this.sysAdmin : this.session.user.projectAdmin.some(e => e === this.project.id);
this.projectAdmin = this.sysAdmin ? this.sysAdmin : this.session.user.projectAdmin.some(e => e === response.id);
},
(error: ApiResponseError) => {
this._errorHandler.showMessage(error);
Expand Down
7 changes: 1 addition & 6 deletions src/app/project/list/list-item/list-item.component.ts
Expand Up @@ -44,9 +44,6 @@ export class ListItemComponent implements OnInit {
sysAdmin = false;
projectAdmin = false;

// project data
project: ReadProject;

expandedNode: string;

constructor(
Expand All @@ -66,10 +63,8 @@ export class ListItemComponent implements OnInit {
// get the project data from cache
this._cache.get(this.projectCode).subscribe(
(response: ReadProject) => {
this.project = response;

// is logged-in user projectAdmin?
this.projectAdmin = this.sysAdmin ? this.sysAdmin : this.session.user.projectAdmin.some(e => e === this.project.id);
this.projectAdmin = this.sysAdmin ? this.sysAdmin : this.session.user.projectAdmin.some(e => e === response.id);
},
(error: ApiResponseError) => {
this._errorHandler.showMessage(error);
Expand Down

0 comments on commit ff8b5a8

Please sign in to comment.