catalog-backend-module-github: fix defaultUserTransformer typings

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-10-02 16:58:17 +02:00
parent 5b74ce4c1f
commit 7ec10602ff
3 changed files with 9 additions and 9 deletions
+1 -6
View File
@@ -270,12 +270,7 @@ const githubOrgProvider = GithubOrgEntityProvider.fromConfig(env.config, {
/* highlight-add-start */
userTransformer: async (user, ctx) => {
const entity = await defaultUserTransformer(user, ctx);
if (
entity &&
isUserEntity(entity) &&
entity.spec.profile &&
user.organizationVerifiedDomainEmails?.length
) {
if (entity && user.organizationVerifiedDomainEmails?.length) {
entity.spec.profile!.email = user.organizationVerifiedDomainEmails[0];
}
return entity;