feat: exclude some work from service
This commit is contained in:
parent
e233869efe
commit
bada98d12d
1 changed files with 3 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ type QuotationCreate = {
|
|||
work: {
|
||||
id: string;
|
||||
// Name field will come from original data
|
||||
excluded?: boolean;
|
||||
product: {
|
||||
id: string;
|
||||
amount: number;
|
||||
|
|
@ -335,6 +336,8 @@ export class QuotationController extends Controller {
|
|||
detail: currentService.detail,
|
||||
attributes: currentService.attributes as Prisma.JsonObject,
|
||||
work: a.work.flatMap((c) => {
|
||||
if (c.excluded) return [];
|
||||
|
||||
const currentWork = currentService.work.find((d) => d.id === c.id);
|
||||
|
||||
if (!currentWork) return []; // should not possible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue