mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
18 lines
364 B
TypeScript
18 lines
364 B
TypeScript
import { User } from 'next-auth';
|
|
import prisma from '../../utils/prisma';
|
|
|
|
export default async function updateUser(user: User) {
|
|
return await prisma.user.update({
|
|
where: {
|
|
email: user.email,
|
|
google_id: user.id,
|
|
},
|
|
data: {
|
|
email: user.email,
|
|
google_id: user.id,
|
|
name: user.name,
|
|
image: user.image,
|
|
},
|
|
});
|
|
}
|