mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
Update project-router.ts
This commit is contained in:
@@ -262,7 +262,7 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
invitees: UsersSchema.array(),
|
invitee: UsersSchema,
|
||||||
latestKey: ProjectKeysSchema.optional()
|
latestKey: ProjectKeysSchema.optional()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -277,21 +277,21 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
emails: [req.body.email]
|
emails: [req.body.email]
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const invitee of invitees) {
|
const invitee = invitees[0];
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await server.services.auditLog.createAuditLog({
|
// eslint-disable-next-line no-await-in-loop
|
||||||
...req.auditLogInfo,
|
await server.services.auditLog.createAuditLog({
|
||||||
projectId: req.params.workspaceId,
|
...req.auditLogInfo,
|
||||||
event: {
|
projectId: req.params.workspaceId,
|
||||||
type: EventType.ADD_WORKSPACE_MEMBER,
|
event: {
|
||||||
metadata: {
|
type: EventType.ADD_WORKSPACE_MEMBER,
|
||||||
userId: invitee.id,
|
metadata: {
|
||||||
email: invitee.email
|
userId: invitee.id,
|
||||||
}
|
email: invitee.email
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
return { invitees, latestKey };
|
return { invitee, latestKey };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user