diff --git a/ExpressAPI/src/controllers/Session.ts b/ExpressAPI/src/controllers/Session.ts index fdbd80032cf4751e4ba9f3204f027986b7377e90..2fd274751f658faf3bfd3ee1a488cb71bd3b773e 100644 --- a/ExpressAPI/src/controllers/Session.ts +++ b/ExpressAPI/src/controllers/Session.ts @@ -44,7 +44,7 @@ class Session { } private async getResponse(code: number, data: any, descriptionOverride?: string): Promise<any> { - const profileJson = await this.profile.toJsonObject(false); + const profileJson = await this.profile.toJsonObject(); let reasonPhrase = ''; diff --git a/ExpressAPI/src/models/Enonce.ts b/ExpressAPI/src/models/Enonce.ts index 1ae10f94ee632c3485b22bda28aa085dec0f1046..2fbe0bea04425afa4a643a9abe77473fb3f3ac6f 100644 --- a/ExpressAPI/src/models/Enonce.ts +++ b/ExpressAPI/src/models/Enonce.ts @@ -13,14 +13,14 @@ class Enonce extends Model { enonceGitlabLastInfo: string = ''; enonceGitlabLastInfoTs: number = null; - public async toJsonObject(lightVersion: boolean): Promise<Object> { + public async toJsonObject(): Promise<Object> { const result = { 'id' : this.enonceID, 'name' : this.enonceName, 'gitlabId' : this.enonceGitlabId, 'gitlabLink' : this.enonceGitlabLink, - 'gitlabCreationInfo': this.enonceGitlabCreationInfo, - 'gitlabLastInfo' : this.enonceGitlabLastInfo, + 'gitlabCreationInfo': JSON.parse(this.enonceGitlabCreationInfo), + 'gitlabLastInfo' : JSON.parse(this.enonceGitlabLastInfo), 'gitlabLastInfoTs' : this.enonceGitlabLastInfoTs }; diff --git a/ExpressAPI/src/models/EnonceStaff.ts b/ExpressAPI/src/models/EnonceStaff.ts index 96740813109612c7e8a0ef1a788e56b1acdc39fd..3af23a4482a343bb51e3566f4a60eb6476fa6172 100644 --- a/ExpressAPI/src/models/EnonceStaff.ts +++ b/ExpressAPI/src/models/EnonceStaff.ts @@ -8,7 +8,7 @@ class EnonceStaff extends Model { enonceID: number = null; userID: number = null; - public async toJsonObject(lightVersion: boolean): Promise<Object> { + public async toJsonObject(): Promise<Object> { const result = { 'enonceID': this.enonceID, 'userID' : this.userID diff --git a/ExpressAPI/src/models/Model.ts b/ExpressAPI/src/models/Model.ts index fdb06183af1601d1c8065467dc88eaa0d2dbf2b2..96a3a96e07e012420e411cb0c44674b4d79e1f39 100644 --- a/ExpressAPI/src/models/Model.ts +++ b/ExpressAPI/src/models/Model.ts @@ -15,7 +15,7 @@ abstract class Model extends Object { return result; } - public abstract toJsonObject(lightVersion: boolean): Promise<Object> + public abstract toJsonObject(): Promise<Object> } diff --git a/ExpressAPI/src/models/User.ts b/ExpressAPI/src/models/User.ts index 0cce0f7a9df8ca7f3a576f8012d5b6b41559e7e4..88af3c2cd233823722af492ccde6092382cc4c8d 100644 --- a/ExpressAPI/src/models/User.ts +++ b/ExpressAPI/src/models/User.ts @@ -23,7 +23,7 @@ class User extends Model { currentSession: Session = null; - public async toJsonObject(lightVersion: boolean): Promise<Object> { + public async toJsonObject(): Promise<Object> { const result = { 'id' : this.userID, 'firstName' : this.userFirstName,