@react-pakistan/util-functions 1.22.78 → 1.22.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -73,7 +73,7 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
|
|
|
73
73
|
let quoteInvoice;
|
|
74
74
|
if (mode === 'Create') {
|
|
75
75
|
let mappedServices;
|
|
76
|
-
if (services.length) {
|
|
76
|
+
if (services === null || services === void 0 ? void 0 : services.length) {
|
|
77
77
|
mappedServices = services.map((item) => {
|
|
78
78
|
const itemToReturn = Object.assign({}, item);
|
|
79
79
|
delete itemToReturn.mode;
|
|
@@ -82,8 +82,7 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
|
|
|
82
82
|
}
|
|
83
83
|
if (customerId || companyId) {
|
|
84
84
|
quoteInvoice = yield prisma.quoteInvoice.create({
|
|
85
|
-
data: {
|
|
86
|
-
category,
|
|
85
|
+
data: Object.assign({ category,
|
|
87
86
|
companyId,
|
|
88
87
|
currency,
|
|
89
88
|
customerId,
|
|
@@ -97,16 +96,13 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
|
|
|
97
96
|
subTotal,
|
|
98
97
|
taxValue,
|
|
99
98
|
total,
|
|
100
|
-
createdAt,
|
|
99
|
+
createdAt }, (mappedServices && {
|
|
101
100
|
services: {
|
|
102
101
|
createMany: {
|
|
103
102
|
data: mappedServices,
|
|
104
103
|
},
|
|
105
104
|
},
|
|
106
|
-
|
|
107
|
-
// connect: products,
|
|
108
|
-
// },
|
|
109
|
-
},
|
|
105
|
+
})),
|
|
110
106
|
include: {
|
|
111
107
|
products: true,
|
|
112
108
|
},
|