From 3c0874926039b00df9a2e5e049d58580a5cf4421 Mon Sep 17 00:00:00 2001 From: Paulina Date: Wed, 8 Feb 2023 14:13:07 +0100 Subject: [PATCH 1/2] update User with picture --- src/model/User.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/model/User.ts b/src/model/User.ts index 7d002674..02cddf95 100644 --- a/src/model/User.ts +++ b/src/model/User.ts @@ -7,13 +7,13 @@ const paramDefaults = {}; export interface UserGetParams { id: string; [key: string]: any; -}; +} export interface UserQueryParams { - projectId: string, - environmentId: string, + projectId: string; + environmentId: string; [key: string]: any; -}; +} export default class User extends Ressource { id: string; @@ -22,9 +22,14 @@ export default class User extends Ressource { has_key: boolean; display_name: string; email: string; - username: string; + username: string; + picture: string; - constructor(user: APIObject, url = `${_url}/:id`, modifiableField: Array = []) { + constructor( + user: APIObject, + url = `${_url}/:id`, + modifiableField: Array = [] + ) { const { id } = user; super(url, paramDefaults, { id }, user, [], modifiableField); @@ -36,12 +41,13 @@ export default class User extends Ressource { this.display_name = ""; this.email = ""; this.username = ""; + this.picture = ""; } static get(params: UserGetParams, customUrl?: string, options?: object) { const { id, ...queryParams } = params; const { api_url } = getConfig(); - + console.log({ params }); return super._get( customUrl || `${api_url}${_url}/:id`, { id }, From 84bfb3d34172d15e5926a6a418c3c625921e25e9 Mon Sep 17 00:00:00 2001 From: Paulina Date: Wed, 8 Feb 2023 14:15:07 +0100 Subject: [PATCH 2/2] clean up --- src/model/User.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/User.ts b/src/model/User.ts index 02cddf95..8fb84a94 100644 --- a/src/model/User.ts +++ b/src/model/User.ts @@ -47,7 +47,7 @@ export default class User extends Ressource { static get(params: UserGetParams, customUrl?: string, options?: object) { const { id, ...queryParams } = params; const { api_url } = getConfig(); - console.log({ params }); + return super._get( customUrl || `${api_url}${_url}/:id`, { id },