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,
|
Security,
|
||||||
Tags,
|
Tags,
|
||||||
} from "tsoa";
|
} from "tsoa";
|
||||||
import express from "express";
|
|
||||||
import { PaymentStatus, Prisma } from "@prisma/client";
|
import { PaymentStatus, Prisma } from "@prisma/client";
|
||||||
import prisma from "../db";
|
import prisma from "../db";
|
||||||
import { notFoundError } from "../utils/error";
|
import { notFoundError } from "../utils/error";
|
||||||
|
|
@ -83,12 +82,27 @@ export class QuotationPayment extends Controller {
|
||||||
return { result, page, pageSize, total };
|
return { result, page, pageSize, total };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("{quotationId}")
|
@Get("{paymentId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
async getPayment(@Path() quotationId: string) {
|
async getPayment(@Path() paymentId: string) {
|
||||||
const record = await prisma.payment.findFirst({
|
const record = await prisma.payment.findFirst({
|
||||||
where: { invoice: { quotationId } },
|
where: { id: paymentId },
|
||||||
include: { createdBy: true },
|
include: {
|
||||||
|
invoice: {
|
||||||
|
include: {
|
||||||
|
productServiceList: {
|
||||||
|
include: {
|
||||||
|
worker: true,
|
||||||
|
service: true,
|
||||||
|
work: true,
|
||||||
|
product: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
quotation: true,
|
||||||
|
createdBy: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue