mirror of
https://github.com/aditama-labs/nest-autocrud.git
synced 2024-11-21 19:06:21 +00:00
feat: add service to all prisma process
This commit is contained in:
parent
55fe243e00
commit
d25afafbd3
@ -1,12 +1,14 @@
|
|||||||
import { DefaultProcess } from '@aditama-labs/nest-autocrud/skeleton';
|
import { DefaultProcess } from '@aditama-labs/nest-autocrud/skeleton';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { PRISMA_DELEGATE } from '../constants';
|
import { PRISMA_DELEGATE } from '../constants';
|
||||||
|
import { PrismaService } from '../prisma.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PrismaProcess extends DefaultProcess {
|
export class PrismaProcess extends DefaultProcess {
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(PRISMA_DELEGATE)
|
@Inject(PRISMA_DELEGATE)
|
||||||
private delegate,
|
private delegate,
|
||||||
|
public prisma: PrismaService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@aditama-labs/nest-autocrud",
|
"name": "@aditama-labs/nest-autocrud",
|
||||||
"version": "0.1.4",
|
"version": "0.3.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@aditama-labs/nest-autocrud",
|
"name": "@aditama-labs/nest-autocrud",
|
||||||
"version": "0.1.4",
|
"version": "0.3.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs/common": "^10.0.0",
|
"@nestjs/common": "^10.0.0",
|
||||||
|
@ -1,21 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
PRISMA_DELEGATE,
|
PrismaReadProcess
|
||||||
PrismaReadProcess,
|
|
||||||
PrismaService,
|
|
||||||
} from '@aditama-labs/nest-autocrud/prisma';
|
} from '@aditama-labs/nest-autocrud/prisma';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CustomReadProcess extends PrismaReadProcess {
|
export class CustomReadProcess extends PrismaReadProcess {
|
||||||
constructor(
|
|
||||||
@Inject(PRISMA_DELEGATE)
|
|
||||||
delegate,
|
|
||||||
@Inject()
|
|
||||||
private prisma: PrismaService,
|
|
||||||
) {
|
|
||||||
super(delegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
customResult;
|
customResult;
|
||||||
|
|
||||||
async before(): Promise<any> {
|
async before(): Promise<any> {
|
||||||
|
Loading…
Reference in New Issue
Block a user