@react-pakistan/util-functions 1.22.80 → 1.22.81

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.
@@ -27,7 +27,7 @@ interface PostQuoteInvoiceArgs {
27
27
  mode: string;
28
28
  note: string;
29
29
  ref: string;
30
- services: any[];
30
+ services: any[] | undefined;
31
31
  status: string;
32
32
  subTotal: string;
33
33
  taxValue: string;
@@ -35,7 +35,7 @@ interface PostQuoteInvoiceArgs {
35
35
  products: [{
36
36
  id: string;
37
37
  productQuantity: string;
38
- }];
38
+ }] | undefined;
39
39
  createdAt: string;
40
40
  phone: string;
41
41
  lastName: string;
@@ -70,6 +70,7 @@ exports.postQuotesInvoices = postQuotesInvoices;
70
70
  const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total,
71
71
  // productIds,
72
72
  products, createdAt, phone, lastName, firstName, email, country, city, address, prisma, }) {
73
+ var _e;
73
74
  let quoteInvoice;
74
75
  if (mode === 'Create') {
75
76
  let mappedServices;
@@ -107,7 +108,7 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
107
108
  products: true,
108
109
  },
109
110
  });
110
- products.forEach((_e) => __awaiter(void 0, [_e], void 0, function* ({ id: _id, productQuantity }) {
111
+ products === null || products === void 0 ? void 0 : products.forEach((_f) => __awaiter(void 0, [_f], void 0, function* ({ id: _id, productQuantity }) {
111
112
  yield prisma.quotesInvoicesOnStellarProducts.create({
112
113
  data: {
113
114
  quoteInvoiceId: quoteInvoice === null || quoteInvoice === void 0 ? void 0 : quoteInvoice.id,
@@ -175,15 +176,13 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
175
176
  id,
176
177
  },
177
178
  });
178
- const filteredEditServices = services.filter(({ mode: _mode }) => _mode === 'Edit');
179
- const filteredCreateServices = services
180
- .filter(({ mode: __mode }) => __mode === 'Create')
181
- .map((item) => {
179
+ const filteredEditServices = services === null || services === void 0 ? void 0 : services.filter(({ mode: _mode }) => _mode === 'Edit');
180
+ const filteredCreateServices = (_e = services === null || services === void 0 ? void 0 : services.filter(({ mode: __mode }) => __mode === 'Create')) === null || _e === void 0 ? void 0 : _e.map((item) => {
182
181
  const toReturn = Object.assign({}, item);
183
182
  delete toReturn.mode;
184
183
  return (Object.assign(Object.assign({}, toReturn), { quoteInvoiceId: id }));
185
184
  });
186
- filteredEditServices.map((item) => __awaiter(void 0, void 0, void 0, function* () {
185
+ filteredEditServices === null || filteredEditServices === void 0 ? void 0 : filteredEditServices.map((item) => __awaiter(void 0, void 0, void 0, function* () {
187
186
  yield prisma.stellarService.update({
188
187
  where: {
189
188
  id: item.id,
@@ -248,7 +247,7 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
248
247
  return quoteInvoice;
249
248
  });
250
249
  exports.postQuoteInvoice = postQuoteInvoice;
251
- const deleteQuoteInvoice = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id, }) {
250
+ const deleteQuoteInvoice = (_g) => __awaiter(void 0, [_g], void 0, function* ({ prisma, id, }) {
252
251
  const quoteInvoice = yield prisma.quoteInvoice.delete({
253
252
  where: {
254
253
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.22.80",
3
+ "version": "1.22.81",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {