mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Add sequelize index file
This commit is contained in:
parent
6f00481c25
commit
d20b00532d
12 changed files with 77 additions and 50 deletions
11
src/utils/resolvers.ts
Normal file
11
src/utils/resolvers.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
import User from "@/sequelize/models/user";
|
||||
import type { Session } from "@auth/core";
|
||||
|
||||
export async function getUser(session: Session | null) {
|
||||
if (!session) return null
|
||||
|
||||
const { id } = session
|
||||
const user = await User.findByPk(id)
|
||||
return user
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue