@uappi/public-sdk 1.1.18 → 1.1.20

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.
@@ -2,6 +2,8 @@ import { usePublicApi } from '..';
2
2
 
3
3
  import type {
4
4
  ApiParams,
5
+ CreateProductReviewMediaResponse,
6
+ CreateProductReviewResponse,
5
7
  ProductReviewRequest,
6
8
  ProductReviewResponse,
7
9
  ReviewConditionFields,
@@ -31,7 +33,7 @@ export function createProductReview(
31
33
  productId: number,
32
34
  payload: ProductReviewRequest,
33
35
  ) {
34
- return usePublicApi<ProductReviewRequest>({
36
+ return usePublicApi<CreateProductReviewResponse>({
35
37
  endpoint: `/review/product/${productId}`,
36
38
  method: 'POST',
37
39
  payload,
@@ -49,7 +51,7 @@ export function createImageProductReview(
49
51
  formData.append(`medias[${index}]`, file);
50
52
  });
51
53
 
52
- return usePublicApi<ProductReviewRequest>({
54
+ return usePublicApi<Array<CreateProductReviewMediaResponse>>({
53
55
  endpoint: `/review/${productReviewId}/product/media`,
54
56
  method: 'POST',
55
57
  payload: formData,
@@ -1,4 +1,4 @@
1
- import type { Pagination, SimpleProduct } from '../..';
1
+ import type { Pagination, SimpleProduct } from "../..";
2
2
 
3
3
  export interface ProductReview {
4
4
  id: number;
@@ -34,3 +34,27 @@ export interface ProductReviewRequest {
34
34
  recommended: boolean;
35
35
  score: number;
36
36
  }
37
+
38
+ export interface CreateProductReviewResponse {
39
+ active: boolean;
40
+ comment: string;
41
+ createdAt: string;
42
+ customerId: number;
43
+ email: string;
44
+ id: number;
45
+ masked: boolean;
46
+ medias: null;
47
+ name: string;
48
+ product: null;
49
+ productId: number;
50
+ recommended: boolean;
51
+ score: number;
52
+ updatedAt: string;
53
+ }
54
+
55
+ export interface CreateProductReviewMediaResponse {
56
+ createdAt: string;
57
+ image: string;
58
+ mediaId: number;
59
+ reviewId: number;
60
+ }
@@ -187,6 +187,8 @@ import type {
187
187
  ProductReviewRequest,
188
188
  ProductReviewResponse,
189
189
  ProductReview,
190
+ CreateProductReviewResponse,
191
+ CreateProductReviewMediaResponse,
190
192
  } from './endpoints/review/review.interfaces';
191
193
  import type { Seal, SealSetting } from './endpoints/seal/seal.interfaces';
192
194
  import type { Seals } from './endpoints/seal/seal.types';
@@ -327,6 +329,8 @@ export type {
327
329
 
328
330
  // Avaliaçoes
329
331
  ProductReviewRequest,
332
+ CreateProductReviewResponse,
333
+ CreateProductReviewMediaResponse,
330
334
  ProductReviewResponse,
331
335
  ProductReview,
332
336
  ReviewConditionFields,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {