Skip to content

Commit

Permalink
Merge pull request #1006 from npocccties/gh-1005
Browse files Browse the repository at this point in the history
fix: name, emailが空のとき上書きしないように変更
  • Loading branch information
ties-makimura committed Nov 17, 2023
2 parents 6c9c61a + ace6acc commit 84268f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/utils/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export async function upsertUser({ ltiConsumerId, ...user }: UserProps) {
...user,
ltiConsumer: { connect: { id: ltiConsumerId } },
},
update: user,
update: {
ltiUserId: user.ltiUserId,
// NOTE: "" の場合 … 上書きしない https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined
name: user.name || undefined,
email: user.email || undefined,
},
});
}

Expand Down

0 comments on commit 84268f9

Please sign in to comment.