init to partner module
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { ResponseMapper } from '@/common/response/response-mapper'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class PartnerService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async getInfo(partner_id: string) {
|
||||
const partner = await this.prisma.partner.findUniqueOrThrow({
|
||||
where: {
|
||||
id: partner_id,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
status: true,
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.single(partner)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user