Skip to content

Commit ac8e8ec

Browse files
committed
fix: review comment
1 parent e790d3b commit ac8e8ec

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ import { getPrisma } from "../../../prisma";
33
import { UpsertGitProfileInput } from "./git-profile.types";
44

55
export const upsertGitProfile = async (
6-
args: UpsertGitProfileInput
6+
input: UpsertGitProfileInput
77
): Promise<GitProfile> => {
8-
const { gitProvider, gitUserId, handle, name, avatar, bio, location } = args;
9-
108
const data = {
11-
gitProvider,
12-
gitUserId,
13-
handle,
14-
name,
15-
avatar: avatar ?? null,
16-
bio: bio ?? null,
17-
location: location ?? null,
9+
...input,
10+
avatar: input.avatar ?? undefined,
11+
bio: input.bio ?? undefined,
12+
location: input.location ?? undefined,
1813
};
1914

2015
return getPrisma().gitProfile.upsert({
2116
where: {
22-
gitProvider_gitUserId: { gitUserId, gitProvider },
17+
gitProvider_gitUserId: {
18+
gitUserId: input.gitUserId,
19+
gitProvider: input.gitProvider,
20+
},
2321
},
2422
create: data,
2523
update: data,

0 commit comments

Comments
 (0)