Skip to content

Commit 9562310

Browse files
authored
Merge pull request #140 from imcaizheng/team-service-include-members-and-invites
Return invites and members property for teams
2 parents df97ad4 + a0f0f7a commit 9562310

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

docs/swagger.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,18 @@ components:
20942094
type: string
20952095
example: "1212"
20962096
description: "The team name."
2097+
invites:
2098+
type: array
2099+
items:
2100+
type: object
2101+
description: "The invites of the project"
2102+
example: [{"createdAt": "2021-02-08T09:21:00.885Z", "createdBy": 40159127, "deletedBy": null, "email": null, "id": 3008, "projectId": 16819, "role": "customer", "status": "pending", "updatedAt": "2021-02-08T09:21:00.885Z", "updatedBy": 40159127, "userId": 40153913}]
2103+
members:
2104+
type: array
2105+
items:
2106+
type: object
2107+
description: "The members of the project"
2108+
example: [{"lastName": "L_NAME", "role": "customer", "updatedBy": 21926562, "handle": "Tester123", "userId": 21926562, "deletedBy": null, "createdAt": "2021-01-12T10:58:26.237Z", "firstName": "F_NAME", "createdBy": 21926562, "isPrimary": false, "id": 13833, "projectId": 16893, "email": "[email protected]", "updatedAt": "2021-01-12T10:58:26.237Z"}]
20972109
startDate:
20982110
type: string
20992111
format: date-time
@@ -2177,6 +2189,18 @@ components:
21772189
type: string
21782190
example: "1212"
21792191
description: "The team name."
2192+
invites:
2193+
type: array
2194+
items:
2195+
type: object
2196+
description: "The invites of the project"
2197+
example: [{"createdAt": "2021-02-08T09:21:00.885Z", "createdBy": 40159127, "deletedBy": null, "email": null, "id": 3008, "projectId": 16819, "role": "customer", "status": "pending", "updatedAt": "2021-02-08T09:21:00.885Z", "updatedBy": 40159127, "userId": 40153913}]
2198+
members:
2199+
type: array
2200+
items:
2201+
type: object
2202+
description: "The members of the project"
2203+
example: [{"lastName": "L_NAME", "role": "customer", "updatedBy": 21926562, "handle": "Tester123", "userId": 21926562, "deletedBy": null, "createdAt": "2021-01-12T10:58:26.237Z", "firstName": "F_NAME", "createdBy": 21926562, "isPrimary": false, "id": 13833, "projectId": 16893, "email": "[email protected]", "updatedAt": "2021-01-12T10:58:26.237Z"}]
21802204
startDate:
21812205
type: string
21822206
format: date-time

src/common/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ async function getProjects (currentUser, criteria = {}) {
686686
.set('Accept', 'application/json')
687687
localLogger.debug({ context: 'getProjects', message: `response body: ${JSON.stringify(res.body)}` })
688688
const result = _.map(res.body, item => {
689-
return _.pick(item, ['id', 'name'])
689+
return _.pick(item, ['id', 'name', 'invites', 'members'])
690690
})
691691
return {
692692
total: Number(_.get(res.headers, 'x-total')),
@@ -816,7 +816,7 @@ async function getProjectById (currentUser, id) {
816816
.set('Content-Type', 'application/json')
817817
.set('Accept', 'application/json')
818818
localLogger.debug({ context: 'getProjectById', message: `response body: ${JSON.stringify(res.body)}` })
819-
return _.pick(res.body, ['id', 'name'])
819+
return _.pick(res.body, ['id', 'name', 'invites', 'members'])
820820
} catch (err) {
821821
if (err.status === HttpStatus.FORBIDDEN) {
822822
throw new errors.ForbiddenError(`You are not allowed to access the project with id ${id}`)

0 commit comments

Comments
 (0)