fix: ppob callback

This commit is contained in:
ilham 2022-05-24 00:34:17 +07:00
parent d2deb841f9
commit c26294ac50
2 changed files with 32 additions and 3 deletions

View File

@ -155,14 +155,13 @@ export class TransactionController {
}; };
} }
@Get('check-bill-history/:id') @Get('check-bill-history')
async getCheckBillHistory( async getCheckBillHistory(
@Param('id') id: string, @Param('id') id: string,
@Request() req, @Request() req,
) { ) {
const data = await this.transactionService.findOne( const data = await this.transactionService.findAll(
req.user.userId, req.user.userId,
id,
); );
return { return {

View File

@ -1399,6 +1399,36 @@ export class TransactionService {
} }
} }
async findAll(user: string) {
try {
return this.checkBillHistoryRepository.find({
where: {
user: user,
},
select: [
'amount',
'admin_price',
'product_code',
'destination',
'trx_id',
'partner_trx_id',
'createdAt',
],
order: {
createdAt: 'DESC',
}
});
} catch (e) {
throw new HttpException(
{
statusCode: HttpStatus.NOT_FOUND,
error: 'Billing not found',
},
HttpStatus.NOT_FOUND,
);
}
}
async topUpHistoryByUser( async topUpHistoryByUser(
page: number, page: number,
user: string, user: string,