diff --git a/libs/prisma/src/processes/create.process.ts b/libs/prisma/src/processes/create.process.ts index 5670b62..fa17e90 100644 --- a/libs/prisma/src/processes/create.process.ts +++ b/libs/prisma/src/processes/create.process.ts @@ -6,15 +6,10 @@ export class PrismaCreateProcess implements CreateProcess { public data; - public result; async process(): Promise { this.result = await this.getDelegate().create({ data: this.data, }); } - - output() { - this.result; - } } diff --git a/libs/prisma/src/processes/delete.process.ts b/libs/prisma/src/processes/delete.process.ts index e66ad15..2bdde3b 100644 --- a/libs/prisma/src/processes/delete.process.ts +++ b/libs/prisma/src/processes/delete.process.ts @@ -6,15 +6,10 @@ export class PrismaDeleteProcess implements DeleteProcess { public id: any; - private result: any; async process(): Promise { this.result = await this.getDelegate().delete({ where: { id: this.id }, }); } - - output() { - return this.result; - } } diff --git a/libs/prisma/src/processes/list.process.ts b/libs/prisma/src/processes/list.process.ts index d0f776a..f8dd62a 100644 --- a/libs/prisma/src/processes/list.process.ts +++ b/libs/prisma/src/processes/list.process.ts @@ -2,13 +2,7 @@ import { ListProcess } from '@aditama-labs/nest-autocrud/skeleton'; import { PrismaProcess } from './prisma.process'; export class PrismaListProcess extends PrismaProcess implements ListProcess { - private result; - async process(): Promise { this.result = await this.getDelegate().findMany(); } - - output() { - return this.result; - } } diff --git a/libs/prisma/src/processes/pagination.process.ts b/libs/prisma/src/processes/pagination.process.ts index 414b8f3..137947a 100644 --- a/libs/prisma/src/processes/pagination.process.ts +++ b/libs/prisma/src/processes/pagination.process.ts @@ -6,7 +6,6 @@ export class PrismaPaginationProcess implements PaginationProcess { public params: { page: number; limit: number }; - private result; async process(): Promise { const { page, limit } = this.params; @@ -18,8 +17,4 @@ export class PrismaPaginationProcess take: parseInt(limit.toString(), 10), }); } - - output() { - return this.result; - } } diff --git a/libs/prisma/src/processes/read.process.ts b/libs/prisma/src/processes/read.process.ts index 4c0b627..25f6c46 100644 --- a/libs/prisma/src/processes/read.process.ts +++ b/libs/prisma/src/processes/read.process.ts @@ -3,15 +3,10 @@ import { PrismaProcess } from './prisma.process'; export class PrismaReadProcess extends PrismaProcess implements ReadProcess { public id; - private result; async process(): Promise { this.result = await this.getDelegate().findUnique({ where: { id: this.id }, }); } - - output() { - return this.result; - } } diff --git a/libs/prisma/src/processes/update.process.ts b/libs/prisma/src/processes/update.process.ts index 9dc7e6c..faf282f 100644 --- a/libs/prisma/src/processes/update.process.ts +++ b/libs/prisma/src/processes/update.process.ts @@ -7,7 +7,6 @@ export class PrismaUpdateProcess { public id: any; public data: any; - private result: any; async process(): Promise { this.result = await this.getDelegate().update({ @@ -15,8 +14,4 @@ export class PrismaUpdateProcess where: { id: this.id }, }); } - - output() { - return this.result; - } } diff --git a/libs/skeleton/src/processes/default.process.ts b/libs/skeleton/src/processes/default.process.ts index efa8b18..075c676 100644 --- a/libs/skeleton/src/processes/default.process.ts +++ b/libs/skeleton/src/processes/default.process.ts @@ -1,6 +1,8 @@ import { ISkeletonProcess } from '../interfaces/skeleton-process.interface'; export class DefaultProcess implements ISkeletonProcess { + protected result; + async initialization(): Promise {} async before(): Promise {} async begin(): Promise {} @@ -8,7 +10,7 @@ export class DefaultProcess implements ISkeletonProcess { async end(): Promise {} async after(): Promise {} - output(): any { - return 'Not Implemented Yet!'; + output() { + return this.result; } }