From 1f896c7d48a1f9cc9f35008c3e183e354babd0c8 Mon Sep 17 00:00:00 2001 From: Soulou Date: Wed, 3 Nov 2021 17:49:08 +0100 Subject: [PATCH 1/2] [Collaborator] Add missing fields user_id/app_id to Collaborator model, update semantic of transfer to mention the ID should be given --- src/Apps/index.ts | 6 +++--- src/models/regional/collaborators.ts | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Apps/index.ts b/src/Apps/index.ts index f7961061..28c7da5d 100644 --- a/src/Apps/index.ts +++ b/src/Apps/index.ts @@ -130,20 +130,20 @@ export default class Apps { * @see https://developers.scalingo.com/apps.html#transfer-ownership-of-an-application * @param appID ID of the application * @param currentName Current name of the application. Used as validation. - * @param ownerEmail Email address of the new owner. + * @param ownerID Email address of the new owner. * @return Promise that when resolved returns the App transferred. */ transfer( appID: string, currentName: string, - ownerEmail: string + ownerID: string ): Promise { return unpackData( this._client.apiClient().patch( `/apps/${appID}`, { app: { - owner: ownerEmail, + owner: ownerID, }, }, { params: { current_name: currentName } } diff --git a/src/models/regional/collaborators.ts b/src/models/regional/collaborators.ts index 2b718b64..127cb8dd 100644 --- a/src/models/regional/collaborators.ts +++ b/src/models/regional/collaborators.ts @@ -13,6 +13,10 @@ export interface Collaborator { id: string; /** Email of the collaborator to invite */ email: string; + /** Unique User ID of the user who accepted the collaboration */ + user_id: string; + /** ID of the application owning the collaborator */ + app_id: string; /** Username of the person to invite */ username: string; /** Status of the invitation */ From 21f27bd66020e5d77edc8456a23af652dae8571e Mon Sep 17 00:00:00 2001 From: Soulou Date: Thu, 4 Nov 2021 09:45:11 +0100 Subject: [PATCH 2/2] eslint --- src/Apps/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Apps/index.ts b/src/Apps/index.ts index 28c7da5d..07aebde1 100644 --- a/src/Apps/index.ts +++ b/src/Apps/index.ts @@ -133,11 +133,7 @@ export default class Apps { * @param ownerID Email address of the new owner. * @return Promise that when resolved returns the App transferred. */ - transfer( - appID: string, - currentName: string, - ownerID: string - ): Promise { + transfer(appID: string, currentName: string, ownerID: string): Promise { return unpackData( this._client.apiClient().patch( `/apps/${appID}`,