From f51a20f0e4c88354eec93f66155370c73d0f883d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 1 Jan 2020 11:33:51 +0100 Subject: [PATCH] Fix issue --- src/controllers/UserController.ts | 2 +- src/entities/User.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index 0b3a371..fb59dee 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -75,7 +75,7 @@ export class UserController { "lastName": user.lastName, "publicPage": user.pageStatus == UserPageStatus.PUBLIC, "openPage": user.pageStatus == UserPageStatus.OPEN, - "virtualDirectory": user.virtualDirectory, + "virtualDirectory": user.hasVirtualDirectory ? user.virtualDirectory : "", "accountImage": this.GetAccountImageURL(user.accountImage, h) }; diff --git a/src/entities/User.ts b/src/entities/User.ts index b43d976..3e0f527 100644 --- a/src/entities/User.ts +++ b/src/entities/User.ts @@ -69,6 +69,12 @@ export class User implements UserBuilder { } } + get hasVirtualDirectory() : boolean { + return this.virtualDirectory != null + && this.virtualDirectory != "null" + && this.virtualDirectory.length > 0 + } + get hasWebsite() : boolean { return this.personnalWebsite && this.personnalWebsite != null