@uappi/public-sdk 1.1.16 → 1.1.18
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.
|
@@ -38,6 +38,24 @@ export function createProductReview(
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
export function createImageProductReview(
|
|
42
|
+
productReviewId: number,
|
|
43
|
+
files: File[]
|
|
44
|
+
) {
|
|
45
|
+
|
|
46
|
+
const formData = new FormData();
|
|
47
|
+
|
|
48
|
+
files.forEach((file, index) => {
|
|
49
|
+
formData.append(`medias[${index}]`, file);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return usePublicApi<ProductReviewRequest>({
|
|
53
|
+
endpoint: `/review/${productReviewId}/product/media`,
|
|
54
|
+
method: 'POST',
|
|
55
|
+
payload: formData,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
41
59
|
export function listStoreReview() {
|
|
42
60
|
return usePublicApi<ProductReviewResponse>({
|
|
43
61
|
endpoint: '/review/sales-channel',
|
package/modules/Api/index.ts
CHANGED
|
@@ -62,6 +62,7 @@ import {
|
|
|
62
62
|
import { listShipmentQuoteProduct } from './endpoints/ProductQuoteShipment';
|
|
63
63
|
import {
|
|
64
64
|
createProductReview,
|
|
65
|
+
createImageProductReview,
|
|
65
66
|
listProductReview,
|
|
66
67
|
listStoreReview,
|
|
67
68
|
listCustomerReview,
|
|
@@ -97,6 +98,7 @@ const customization = {
|
|
|
97
98
|
const customer = {
|
|
98
99
|
addNewsletter,
|
|
99
100
|
createProductReview,
|
|
101
|
+
createImageProductReview,
|
|
100
102
|
listProductReview,
|
|
101
103
|
listStoreReview,
|
|
102
104
|
createInterest,
|