feat: add service to all prisma process

This commit is contained in:
Supan Adit Pratama 2024-11-02 23:06:59 +07:00
parent 55fe243e00
commit d25afafbd3
3 changed files with 6 additions and 15 deletions

View File

@ -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();
}

4
package-lock.json generated
View File

@ -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",

View File

@ -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<any> {