mirror of
https://github.com/PeterMaquiran/tvone-api.git
synced 2026-04-18 08:17:52 +00:00
fix prisma interface error
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
|
// Stable location for types + runtime; fixes TS not resolving `@prisma/client` → `.prisma/…` under pnpm + NodeNext
|
||||||
|
output = "../node_modules/.prisma/client"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import {
|
|||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { AuthGuard } from '@nestjs/passport';
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
import { User, UserRole } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
|
import { UserRole } from '@prisma/client';
|
||||||
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
||||||
import { Roles } from '../../shared/decorators/roles.decorator';
|
import { Roles } from '../../shared/decorators/roles.decorator';
|
||||||
import { RolesGuard } from '../../shared/guards/roles.guard';
|
import { RolesGuard } from '../../shared/guards/roles.guard';
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import {
|
|||||||
Injectable,
|
Injectable,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { Article, ArticleStatus, Prisma, User, UserRole } from '@prisma/client';
|
import { ArticleStatus, Prisma, UserRole } from '@prisma/client';
|
||||||
|
import type { Article, User } from '@prisma/client';
|
||||||
import { PrismaService } from '../../shared/prisma/prisma.service';
|
import { PrismaService } from '../../shared/prisma/prisma.service';
|
||||||
import { slugify } from '../../shared/utils/slug';
|
import { slugify } from '../../shared/utils/slug';
|
||||||
import { AttachImageDto } from './dto/attach-image.dto';
|
import { AttachImageDto } from './dto/attach-image.dto';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { AuthGuard } from '@nestjs/passport';
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
||||||
import { BookmarksService } from './bookmarks.service';
|
import { BookmarksService } from './bookmarks.service';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||||
import { ArticleStatus, User } from '@prisma/client';
|
import { ArticleStatus } from '@prisma/client';
|
||||||
|
import type { User } from '@prisma/client';
|
||||||
import { PrismaService } from '../../shared/prisma/prisma.service';
|
import { PrismaService } from '../../shared/prisma/prisma.service';
|
||||||
|
|
||||||
const bookmarkArticleInclude = {
|
const bookmarkArticleInclude = {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { AuthGuard } from '@nestjs/passport';
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
||||||
import { CommentsService } from './comments.service';
|
import { CommentsService } from './comments.service';
|
||||||
import { CreateCommentDto } from './dto/create-comment.dto';
|
import { CreateCommentDto } from './dto/create-comment.dto';
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import {
|
|||||||
Injectable,
|
Injectable,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ArticleStatus, User, UserRole } from '@prisma/client';
|
import { ArticleStatus, UserRole } from '@prisma/client';
|
||||||
|
import type { User } from '@prisma/client';
|
||||||
import { PrismaService } from '../../shared/prisma/prisma.service';
|
import { PrismaService } from '../../shared/prisma/prisma.service';
|
||||||
import { CreateCommentDto } from './dto/create-comment.dto';
|
import { CreateCommentDto } from './dto/create-comment.dto';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { KeycloakAuthGuard } from '../auth/keycloak.guard';
|
import { KeycloakAuthGuard } from '../auth/keycloak.guard';
|
||||||
import { Controller, Get, UseGuards, Request } from '@nestjs/common';
|
import { Controller, Get, Req, UseGuards } from '@nestjs/common';
|
||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
import { Request } from 'express';
|
import type { Request } from 'express';
|
||||||
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
import { UserProvisioningGuard } from '../users/user-provisioning.guard';
|
||||||
|
|
||||||
type ProfileRequest = Request & {
|
type ProfileRequest = Request & {
|
||||||
@@ -19,7 +19,7 @@ type ProfileRequest = Request & {
|
|||||||
export class ProfileController {
|
export class ProfileController {
|
||||||
@UseGuards(KeycloakAuthGuard, UserProvisioningGuard)
|
@UseGuards(KeycloakAuthGuard, UserProvisioningGuard)
|
||||||
@Get()
|
@Get()
|
||||||
getProfile(@Request() req: ProfileRequest) {
|
getProfile(@Req() req: ProfileRequest) {
|
||||||
const kc = req.user;
|
const kc = req.user;
|
||||||
return {
|
return {
|
||||||
keycloak: {
|
keycloak: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Body, Controller, Get, Patch, UseGuards } from '@nestjs/common';
|
import { Body, Controller, Get, Patch, UseGuards } from '@nestjs/common';
|
||||||
import { AuthGuard } from '@nestjs/passport';
|
import { AuthGuard } from '@nestjs/passport';
|
||||||
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
import { CurrentDbUser } from '../../shared/decorators/current-db-user.decorator';
|
||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
import { UpdateMeDto } from './dto/update-me.dto';
|
import { UpdateMeDto } from './dto/update-me.dto';
|
||||||
import { UsersService } from './users.service';
|
import { UsersService } from './users.service';
|
||||||
import { UserProvisioningGuard } from './user-provisioning.guard';
|
import { UserProvisioningGuard } from './user-provisioning.guard';
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { Prisma, User, UserRole } from '@prisma/client';
|
import { Prisma, UserRole } from '@prisma/client';
|
||||||
|
import type { User } from '@prisma/client';
|
||||||
import { PrismaService } from '../../shared/prisma/prisma.service';
|
import { PrismaService } from '../../shared/prisma/prisma.service';
|
||||||
import { KeycloakRequestUser } from '../../shared/decorators/current-user.decorator';
|
import { KeycloakRequestUser } from '../../shared/decorators/current-user.decorator';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
|
|
||||||
export const CurrentDbUser = createParamDecorator(
|
export const CurrentDbUser = createParamDecorator(
|
||||||
(_data: unknown, ctx: ExecutionContext): User => {
|
(_data: unknown, ctx: ExecutionContext): User => {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace Express {
|
namespace Express {
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
|
"paths": {
|
||||||
|
"@prisma/client": ["./node_modules/.prisma/client"]
|
||||||
|
},
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user