@react-pakistan/util-functions 1.22.66 → 1.22.68
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.
|
@@ -203,28 +203,28 @@ products, phone, lastName, firstName, email, country, city, address, prisma, })
|
|
|
203
203
|
// console.log('err', err);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
if (quoteInvoice) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
206
|
+
// if (quoteInvoice) {
|
|
207
|
+
// console.log('=>>>>>', quoteInvoice);
|
|
208
|
+
// // products.map(async (product) => {
|
|
209
|
+
// await prisma.quoteInvoice.update({
|
|
210
|
+
// where: {
|
|
211
|
+
// id: quoteInvoice.id,
|
|
212
|
+
// },
|
|
213
|
+
// data: {
|
|
214
|
+
// products: {
|
|
215
|
+
// connect: products,
|
|
216
|
+
// },
|
|
217
|
+
// // quoteInvoiceId: quoteInvoice?.id,
|
|
218
|
+
// // productId: product.id,
|
|
219
|
+
// // productQuantity: product.productQuantity,
|
|
220
|
+
// },
|
|
221
|
+
// include: {
|
|
222
|
+
// product: true,
|
|
223
|
+
// quoteInvoice: true,
|
|
224
|
+
// },
|
|
225
|
+
// // });
|
|
226
|
+
// });
|
|
227
|
+
// }
|
|
228
228
|
return quoteInvoice;
|
|
229
229
|
});
|
|
230
230
|
exports.postQuoteInvoice = postQuoteInvoice;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.fetchSupabaseImage = void 0;
|
|
13
|
+
const constants_1 = require("../constants");
|
|
14
|
+
const fetchSupabaseImage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ apikey, callback, fetchUrl, token, }) {
|
|
15
|
+
const response = yield fetch(fetchUrl, {
|
|
16
|
+
method: constants_1.API_METHODS.GET,
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
apikey,
|
|
20
|
+
Authorization: `Bearer ${token}`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
if (response.ok) {
|
|
24
|
+
const blob = yield response.blob();
|
|
25
|
+
const url = URL.createObjectURL(blob);
|
|
26
|
+
callback(url);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
console.error(`Error fetching image: ${response.statusText}`);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
exports.fetchSupabaseImage = fetchSupabaseImage;
|