Skip to content

Commit d734351

Browse files
committed
don't overwrite name with login
1 parent 0e0e463 commit d734351

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

api/src/digest/cron.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,16 @@ export class DigestCron {
145145
);
146146

147147
for (const repoContributor of repoContributorsFiltered) {
148-
const [{ id: contributorId }] = await this.contributorsRepository.upsert({
149-
name: repoContributor.name || repoContributor.login,
148+
const contributor = await this.githubService.getUser({
150149
username: repoContributor.login,
151-
url: repoContributor.html_url,
152-
avatarUrl: repoContributor.avatar_url,
150+
});
151+
const [{ id: contributorId }] = await this.contributorsRepository.upsert({
152+
name: contributor.name || contributor.login,
153+
username: contributor.login,
154+
url: contributor.html_url,
155+
avatarUrl: contributor.avatar_url,
153156
runId,
154-
id: `${provider}-${repoContributor.login}`,
157+
id: `${provider}-${contributor.login}`,
155158
});
156159

157160
await this.contributorsRepository.upsertRelationWithRepository({

api/src/github/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { GeneralResponse } from "src/app/types";
22

33
interface GithubUser {
44
login: string;
5-
name: string;
5+
name: string | null;
66
html_url: string;
77
avatar_url: string;
88
type: "User" | "_other";
99
}
1010

11-
interface GithubRepositoryContributor extends GithubUser {
11+
interface GithubRepositoryContributor extends Omit<GithubUser, "name"> {
1212
contributions: number;
1313
}
1414

web/src/pages/team/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function Page(): JSX.Element {
4646
{contributorsList.map((contributor, contributorIndex) => (
4747
<Link
4848
key={contributorIndex}
49-
className="card bg-base-300 sm:max-w-60 w-full rounded-lg flex flex-row border-base-200 border-2 overflow-hidden"
49+
className="card bg-base-300 w-full sm:max-w-52 rounded-lg flex flex-row border-base-200 border-2 overflow-hidden"
5050
href={getContributorURL(contributor)}
5151
>
5252
<img

0 commit comments

Comments
 (0)