feat: Implement initial with admin and mobile clients, authentication, data models, and lead generation scripts.
This commit is contained in:
@@ -124,6 +124,13 @@ export const membersRouter = router({
|
||||
where: { id: input.id, orgId: ctx.orgId },
|
||||
data: input.data,
|
||||
})
|
||||
// Keep user.name in sync when member name changes
|
||||
if (input.data.name) {
|
||||
const m = await ctx.prisma.member.findFirst({ where: { id: input.id }, select: { userId: true } })
|
||||
if (m?.userId) {
|
||||
await ctx.prisma.user.update({ where: { id: m.userId }, data: { name: input.data.name } })
|
||||
}
|
||||
}
|
||||
return member
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user