Skip to content

Commit

Permalink
fix bug queryRuner for payment
Browse files Browse the repository at this point in the history
  • Loading branch information
mehranus committed Nov 12, 2024
1 parent d555786 commit 1b83d91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/order/order.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class OrderService {
const {addresId,discription=undefined}=paymentDto
const querryRuner=this.dataSouers.createQueryRunner()
await querryRuner.connect()
await querryRuner.startTransaction()
try {

const {id:userId}=this.req.user
Expand Down Expand Up @@ -57,10 +58,9 @@ export class OrderService {
throw new BadRequestException("food list is empty")
}


await querryRuner.commitTransaction()
await querryRuner.release()

return order

} catch (error) {
Expand Down
6 changes: 4 additions & 2 deletions src/modules/payment/payment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { PaymentService } from './payment.service';
import { CreatePaymentDto } from './dto/create-payment.dto';
import { UpdatePaymentDto } from './dto/update-payment.dto';
import { UserAuth } from 'src/common/decorators/auth.decorator';
import { ApiTags } from '@nestjs/swagger';
import { ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Response } from 'express';
import { TypeData } from 'src/common/enum/type-data.enum';

@Controller('payment')
@ApiTags("Payment")
Expand All @@ -13,11 +14,12 @@ export class PaymentController {

@Post()
@UserAuth()
@ApiConsumes(TypeData.UrlEncoded,TypeData.Json)
getWayUrl( @Body() paymentDto:CreatePaymentDto ){
return this.paymentService.getWayUrl(paymentDto)
}

@Get('/verfay')
@Get('/verify')
async verifayPayment(
@Query("Authority") authority:string,
@Query("Status") status:string,
Expand Down

0 comments on commit 1b83d91

Please sign in to comment.