Skip to content

Commit

Permalink
don't overwrite name with login
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Oct 5, 2024
1 parent 0e0e463 commit d734351
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions api/src/digest/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ export class DigestCron {
);

for (const repoContributor of repoContributorsFiltered) {
const [{ id: contributorId }] = await this.contributorsRepository.upsert({
name: repoContributor.name || repoContributor.login,
const contributor = await this.githubService.getUser({
username: repoContributor.login,
url: repoContributor.html_url,
avatarUrl: repoContributor.avatar_url,
});
const [{ id: contributorId }] = await this.contributorsRepository.upsert({
name: contributor.name || contributor.login,
username: contributor.login,
url: contributor.html_url,
avatarUrl: contributor.avatar_url,
runId,
id: `${provider}-${repoContributor.login}`,
id: `${provider}-${contributor.login}`,
});

await this.contributorsRepository.upsertRelationWithRepository({
Expand Down
4 changes: 2 additions & 2 deletions api/src/github/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { GeneralResponse } from "src/app/types";

interface GithubUser {
login: string;
name: string;
name: string | null;
html_url: string;
avatar_url: string;
type: "User" | "_other";
}

interface GithubRepositoryContributor extends GithubUser {
interface GithubRepositoryContributor extends Omit<GithubUser, "name"> {
contributions: number;
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/team/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function Page(): JSX.Element {
{contributorsList.map((contributor, contributorIndex) => (
<Link
key={contributorIndex}
className="card bg-base-300 sm:max-w-60 w-full rounded-lg flex flex-row border-base-200 border-2 overflow-hidden"
className="card bg-base-300 w-full sm:max-w-52 rounded-lg flex flex-row border-base-200 border-2 overflow-hidden"
href={getContributorURL(contributor)}
>
<img
Expand Down

0 comments on commit d734351

Please sign in to comment.