Skip to content

Commit

Permalink
fix: add condition for typescript compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
syl-p committed Nov 15, 2021
1 parent 73809d5 commit 7a9e398
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export class PiaCardComponent implements OnInit, OnChanges {
* Add user to new Pia Form
* Update user on author, evaluator and validator
*/
async onAddUser($event: TagModelClass, field: string): void {
async onAddUser($event: TagModelClass, field: string): Promise<void> {
// User selected exist ?
const index = this.users.findIndex(u => u.id === $event.id);

Expand Down
8 changes: 2 additions & 6 deletions src/app/modules/pia/pia.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,16 @@ export class PiaComponent implements OnInit, DoCheck {
complete: () => {
if (this.authService.state) {
this.editMode = [];
console.log(this.authService.currentUserValue);

if (
this.authService.currentUserValue.access_type.includes(
'technique'
) ||
this.authService.currentUserValue.access_type.includes('functional')
) {
this.editMode = ['author', 'validator', 'evaluator', 'guest'];
} else {
this.pia.user_pias.forEach(up => {
if (
up.user.id ===
this.authService.currentUserValue.resource_owner_id
this.authService.currentUserValue.resource_owner_id &&
Array.isArray(this.editMode)
) {
this.editMode.push(up.role);
}
Expand Down

0 comments on commit 7a9e398

Please sign in to comment.