Skip to content

Commit

Permalink
Fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbaumgertner committed Oct 15, 2024
1 parent d3cb7d3 commit aed8d36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Image from 'next/image'
import { useSession } from 'next-auth/react'

import { IUser } from '@/database/models/User'
import { type IRole } from '@/database/models/Role'
import { type IRole } from '@/database/types/Role'

const GET_USERS_AND_ROLES = gql`
#graphql
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/graphql/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ const handler = startServerAndCreateNextHandler(server, {
)?.get(sessionTokenName)?.value
const session = await SessionModel.findOne({ sessionToken: sessionId })
const user = await UserModel.findById(session?.userId).populate('role')
return { user }
return { user: user as IUser & { role: IRole } }
},
})

Expand Down
3 changes: 2 additions & 1 deletion src/database/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import mongoose, { Schema, Document } from 'mongoose'

import Role, { IRole } from './Role'
import Role from './Role'
import { IRole } from '../types/Role'

export interface IUser {
_id: string
Expand Down

0 comments on commit aed8d36

Please sign in to comment.