@react-pakistan/util-functions 1.23.17 → 1.23.19
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.
|
@@ -172,24 +172,28 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ad
|
|
|
172
172
|
delete toReturn.mode;
|
|
173
173
|
return (Object.assign(Object.assign({}, toReturn), { quoteInvoiceId: id }));
|
|
174
174
|
});
|
|
175
|
-
filteredEditServices === null || filteredEditServices === void 0 ? void 0 : filteredEditServices.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
if (filteredEditServices === null || filteredEditServices === void 0 ? void 0 : filteredEditServices.length) {
|
|
176
|
+
filteredEditServices === null || filteredEditServices === void 0 ? void 0 : filteredEditServices.map((item) => __awaiter(void 0, void 0, void 0, function* () {
|
|
177
|
+
yield prisma.stellarService.update({
|
|
178
|
+
where: {
|
|
179
|
+
id: item.id,
|
|
180
|
+
},
|
|
181
|
+
data: {
|
|
182
|
+
description: item.description,
|
|
183
|
+
name: item.name,
|
|
184
|
+
price: item.price,
|
|
185
|
+
quantity: item.quantity,
|
|
186
|
+
quoteInvoiceId: item.quoteInvoiceId,
|
|
187
|
+
total: item.total,
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
if (filteredCreateServices === null || filteredCreateServices === void 0 ? void 0 : filteredCreateServices.length) {
|
|
193
|
+
yield prisma.stellarService.createMany({
|
|
194
|
+
data: filteredCreateServices,
|
|
188
195
|
});
|
|
189
|
-
}
|
|
190
|
-
yield prisma.stellarService.createMany({
|
|
191
|
-
data: filteredCreateServices,
|
|
192
|
-
});
|
|
196
|
+
}
|
|
193
197
|
quoteInvoice = yield prisma.quoteInvoice.update({
|
|
194
198
|
where: {
|
|
195
199
|
id,
|
package/general/format-date.d.ts
CHANGED
package/general/format-date.js
CHANGED
|
@@ -6,12 +6,14 @@ var DATE_FORMATS;
|
|
|
6
6
|
(function (DATE_FORMATS) {
|
|
7
7
|
DATE_FORMATS["LOCALE_DATE"] = "LOCALE_DATE";
|
|
8
8
|
DATE_FORMATS["DD_MM"] = "DD_MM";
|
|
9
|
+
DATE_FORMATS["YYYY_MM_DD"] = "YYYY_MM_DD";
|
|
9
10
|
})(DATE_FORMATS || (exports.DATE_FORMATS = DATE_FORMATS = {}));
|
|
10
11
|
const formatDate = (str, format) => {
|
|
11
|
-
const
|
|
12
|
+
const dateObj = new Date(str);
|
|
12
13
|
const dateMap = {
|
|
13
|
-
[DATE_FORMATS.LOCALE_DATE]:
|
|
14
|
-
[DATE_FORMATS.DD_MM]: `${
|
|
14
|
+
[DATE_FORMATS.LOCALE_DATE]: dateObj.toLocaleDateString(),
|
|
15
|
+
[DATE_FORMATS.DD_MM]: `${dateObj.getDate()} ${(0, get_month_name_1.getMonthName)(dateObj.getMonth())}`,
|
|
16
|
+
[DATE_FORMATS.YYYY_MM_DD]: `${dateObj.getFullYear}-${dateObj.getMonth().toFixed(2)}-${dateObj.getDate()}`,
|
|
15
17
|
};
|
|
16
18
|
return dateMap[format];
|
|
17
19
|
};
|