24 lines
563 B
TypeScript
24 lines
563 B
TypeScript
|
|
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)
|
||
|
|
}
|
||
|
|
}
|