Skip to content

Commit 1a56ca8

Browse files
authored
chore: add type to identity public api payload (#4096)
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
1 parent 2537232 commit 1a56ca8

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

backend/src/api/public/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ components:
10141014
- id
10151015
- value
10161016
- platform
1017+
- type
10171018
- verified
10181019
- verifiedBy
10191020
- source
@@ -1029,6 +1030,12 @@ components:
10291030
platform:
10301031
type: string
10311032
description: Platform name (e.g. github, linkedin, lfid).
1033+
type:
1034+
type: string
1035+
enum:
1036+
- username
1037+
- email
1038+
description: Identity type.
10321039
verified:
10331040
type: boolean
10341041
verifiedBy:

backend/src/api/public/v1/members/identities/createMemberIdentity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export async function createMemberIdentity(req: Request, res: Response): Promise
9494
id: result.id,
9595
value: result.value,
9696
platform: result.platform,
97+
type: result.type,
9798
verified: result.verified,
9899
verifiedBy: result.verifiedBy ?? null,
99100
source: result.source ?? null,

backend/src/api/public/v1/members/identities/getMemberIdentities.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ export async function getMemberIdentities(req: Request, res: Response): Promise<
2727
const rawIdentities = await fetchMemberIdentities(qx, memberId)
2828

2929
const identities = rawIdentities.map(
30-
({ id, value, platform, verified, verifiedBy, source, createdAt, updatedAt }) => ({
30+
({ id, value, platform, type, verified, verifiedBy, source, createdAt, updatedAt }) => ({
3131
id,
3232
value,
3333
platform,
34+
type,
3435
verified,
3536
verifiedBy: verifiedBy ?? null,
3637
source,

backend/src/api/public/v1/members/identities/verifyMemberIdentity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function toReturn(identity: IMemberIdentity) {
5353
id: identity.id,
5454
value: identity.value,
5555
platform: identity.platform,
56+
type: identity.type,
5657
verified: identity.verified,
5758
verifiedBy: identity.verifiedBy ?? null,
5859
source: identity.source,

0 commit comments

Comments
 (0)