From d25afafbd32882ae722e816cf87f9f413f37c079 Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Sat, 2 Nov 2024 23:06:59 +0700 Subject: [PATCH] feat: add service to all prisma process --- libs/prisma/src/processes/prisma.process.ts | 2 ++ package-lock.json | 4 ++-- src/example/custom/domain/custom.read.process.ts | 15 ++------------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/libs/prisma/src/processes/prisma.process.ts b/libs/prisma/src/processes/prisma.process.ts index 639766d..f943b35 100644 --- a/libs/prisma/src/processes/prisma.process.ts +++ b/libs/prisma/src/processes/prisma.process.ts @@ -1,12 +1,14 @@ import { DefaultProcess } from '@aditama-labs/nest-autocrud/skeleton'; import { Inject, Injectable } from '@nestjs/common'; import { PRISMA_DELEGATE } from '../constants'; +import { PrismaService } from '../prisma.service'; @Injectable() export class PrismaProcess extends DefaultProcess { constructor( @Inject(PRISMA_DELEGATE) private delegate, + public prisma: PrismaService, ) { super(); } diff --git a/package-lock.json b/package-lock.json index 5722913..753df9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aditama-labs/nest-autocrud", - "version": "0.1.4", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aditama-labs/nest-autocrud", - "version": "0.1.4", + "version": "0.3.0", "license": "MIT", "dependencies": { "@nestjs/common": "^10.0.0", diff --git a/src/example/custom/domain/custom.read.process.ts b/src/example/custom/domain/custom.read.process.ts index c22bd9f..5dcf0da 100644 --- a/src/example/custom/domain/custom.read.process.ts +++ b/src/example/custom/domain/custom.read.process.ts @@ -1,21 +1,10 @@ import { - PRISMA_DELEGATE, - PrismaReadProcess, - PrismaService, + PrismaReadProcess } from '@aditama-labs/nest-autocrud/prisma'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; @Injectable() export class CustomReadProcess extends PrismaReadProcess { - constructor( - @Inject(PRISMA_DELEGATE) - delegate, - @Inject() - private prisma: PrismaService, - ) { - super(delegate); - } - customResult; async before(): Promise {