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