diff --git a/backend/src/auth/types/auth-request.ts b/backend/src/auth/types/auth-request.ts new file mode 100644 index 0000000..e825052 --- /dev/null +++ b/backend/src/auth/types/auth-request.ts @@ -0,0 +1,8 @@ +import { Request } from 'express'; + +export interface AuthRequest extends Request { + user: { + id: string; + role: 'USER' | 'ADMIN' | 'MOD'; + } | null; +} diff --git a/backend/src/posts/posts.module.ts b/backend/src/posts/posts.module.ts new file mode 100644 index 0000000..1585f1f --- /dev/null +++ b/backend/src/posts/posts.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { PostsController } from './posts.controller'; +import { PostsService } from './posts.service'; +import { PrismaModule } from '../prisma/prisma.module'; +import { PrismaService } from '../prisma/prisma.service'; + +@Module({ + imports: [ + PrismaModule, // 👈 DAS ist der Schlüssel + ], + controllers: [PostsController], + providers: [PostsService, PrismaService,], +}) +export class PostsModule {} diff --git a/backend/src/prisma/prisma.module.ts b/backend/src/prisma/prisma.module.ts new file mode 100644 index 0000000..864e748 --- /dev/null +++ b/backend/src/prisma/prisma.module.ts @@ -0,0 +1,9 @@ +import { Global, Module } from '@nestjs/common'; +import { PrismaService } from '../../prisma/prisma.service'; + +@Global() +@Module({ + providers: [PrismaService], + exports: [PrismaService], +}) +export class PrismaModule {}