fix: wrong operation
This commit is contained in:
parent
7ff88a2487
commit
719a1fb70e
1 changed files with 19 additions and 5 deletions
|
|
@ -12,7 +12,6 @@ import {
|
|||
Security,
|
||||
Tags,
|
||||
} from "tsoa";
|
||||
import express from "express";
|
||||
import { PaymentStatus, Prisma } from "@prisma/client";
|
||||
import prisma from "../db";
|
||||
import { notFoundError } from "../utils/error";
|
||||
|
|
@ -83,12 +82,27 @@ export class QuotationPayment extends Controller {
|
|||
return { result, page, pageSize, total };
|
||||
}
|
||||
|
||||
@Get("{quotationId}")
|
||||
@Get("{paymentId}")
|
||||
@Security("keycloak")
|
||||
async getPayment(@Path() quotationId: string) {
|
||||
async getPayment(@Path() paymentId: string) {
|
||||
const record = await prisma.payment.findFirst({
|
||||
where: { invoice: { quotationId } },
|
||||
include: { createdBy: true },
|
||||
where: { id: paymentId },
|
||||
include: {
|
||||
invoice: {
|
||||
include: {
|
||||
productServiceList: {
|
||||
include: {
|
||||
worker: true,
|
||||
service: true,
|
||||
work: true,
|
||||
product: true,
|
||||
},
|
||||
},
|
||||
quotation: true,
|
||||
createdBy: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
return record;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue