Skip to content

Commit 08d77a8

Browse files
committed
fix: review comment
1 parent ac8e8ec commit 08d77a8

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

apps/api/src/app/gitProfile/services/git-profile.service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export const upsertGitProfile = async (
88
const data = {
99
...input,
1010
avatar: input.avatar ?? undefined,
11-
bio: input.bio ?? undefined,
12-
location: input.location ?? undefined,
1311
};
1412

1513
return getPrisma().gitProfile.upsert({

apps/api/src/app/github/services/github-installation.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const syncGitHubInstallation = async (
3232
gitHubUserToGitProfileData({
3333
nodeId: gitUser.node_id,
3434
avatarUrl: gitUser.avatar_url,
35+
bio: undefined,
36+
location: undefined,
3537
...gitUser,
3638
})
3739
);
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { GitProfile, GitProvider } from "@prisma/client";
22
import { GitHubUser } from "./github-user.types";
3+
import { Optional } from "utility-types";
34

45
export const gitHubUserToGitProfileData = (
56
gitHubUser: GitHubUser
6-
): Omit<GitProfile, "id" | "createdAt" | "updatedAt" | "userId"> => {
7+
): Optional<
8+
Omit<GitProfile, "id" | "createdAt" | "updatedAt" | "userId">,
9+
"bio" | "location"
10+
> => {
711
return {
812
gitProvider: GitProvider.GITHUB,
913
gitUserId: gitHubUser.nodeId,
1014
handle: gitHubUser.login,
1115
name: gitHubUser.name || gitHubUser.login,
1216
avatar: gitHubUser.avatarUrl || null,
13-
bio: gitHubUser.bio || null,
14-
location: gitHubUser.location || null,
17+
bio: gitHubUser.bio,
18+
location: gitHubUser.location,
1519
};
1620
};
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export interface GitHubUser {
22
nodeId: string;
33
login: string;
4-
name?: string;
4+
name?: string | null;
55
avatarUrl?: string;
6-
bio?: string;
7-
location?: string;
6+
bio?: string | null;
7+
location?: string | null;
88
}

0 commit comments

Comments
 (0)