@infrab4a/connect 4.11.2 → 4.12.0-beta.1
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.
package/index.cjs.js
CHANGED
|
@@ -5880,6 +5880,24 @@ class ProductReviewsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5880
5880
|
],
|
|
5881
5881
|
});
|
|
5882
5882
|
}
|
|
5883
|
+
async updateManyStatus(reviews) {
|
|
5884
|
+
return await this.mutation('update_product_review_many', ['affected_rows'], {
|
|
5885
|
+
updates: {
|
|
5886
|
+
type: '[product_review_updates!]',
|
|
5887
|
+
required: true,
|
|
5888
|
+
value: [
|
|
5889
|
+
{
|
|
5890
|
+
_set: { status: true },
|
|
5891
|
+
where: { id: { _in: reviews.filter((review) => review.status).map((review) => review.id) } },
|
|
5892
|
+
},
|
|
5893
|
+
{
|
|
5894
|
+
_set: { status: false },
|
|
5895
|
+
where: { id: { _in: reviews.filter((review) => !review.status).map((review) => review.id) } },
|
|
5896
|
+
},
|
|
5897
|
+
],
|
|
5898
|
+
},
|
|
5899
|
+
});
|
|
5900
|
+
}
|
|
5883
5901
|
aproveReview(id) {
|
|
5884
5902
|
return this.update({ id, status: true });
|
|
5885
5903
|
}
|
package/index.esm.js
CHANGED
|
@@ -5874,6 +5874,24 @@ class ProductReviewsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5874
5874
|
],
|
|
5875
5875
|
});
|
|
5876
5876
|
}
|
|
5877
|
+
async updateManyStatus(reviews) {
|
|
5878
|
+
return await this.mutation('update_product_review_many', ['affected_rows'], {
|
|
5879
|
+
updates: {
|
|
5880
|
+
type: '[product_review_updates!]',
|
|
5881
|
+
required: true,
|
|
5882
|
+
value: [
|
|
5883
|
+
{
|
|
5884
|
+
_set: { status: true },
|
|
5885
|
+
where: { id: { _in: reviews.filter((review) => review.status).map((review) => review.id) } },
|
|
5886
|
+
},
|
|
5887
|
+
{
|
|
5888
|
+
_set: { status: false },
|
|
5889
|
+
where: { id: { _in: reviews.filter((review) => !review.status).map((review) => review.id) } },
|
|
5890
|
+
},
|
|
5891
|
+
],
|
|
5892
|
+
},
|
|
5893
|
+
});
|
|
5894
|
+
}
|
|
5877
5895
|
aproveReview(id) {
|
|
5878
5896
|
return this.update({ id, status: true });
|
|
5879
5897
|
}
|
package/package.json
CHANGED
|
@@ -3,4 +3,5 @@ import { ProductReviews } from '../models';
|
|
|
3
3
|
export interface ProductReviewsRepository extends CrudRepository<ProductReviews> {
|
|
4
4
|
aproveReview(id: number): Promise<ProductReviews>;
|
|
5
5
|
disaproveReview(id: number): Promise<ProductReviews>;
|
|
6
|
+
updateManyStatus(reviews: Pick<ProductReviews, 'id' | 'status'>[]): Promise<void>;
|
|
6
7
|
}
|
package/src/infra/hasura-graphql/repositories/catalog/product-review-hasura-graphql.repository.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const ProductReviewsHasuraGraphQLRepository_base: import("../../../../ut
|
|
|
6
6
|
}, [HasuraConstructorParams<ProductReviews> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
7
|
export declare class ProductReviewsHasuraGraphQLRepository extends ProductReviewsHasuraGraphQLRepository_base implements ProductReviewsRepository {
|
|
8
8
|
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<ProductReviews>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
9
|
+
updateManyStatus(reviews: Pick<ProductReviews, 'id' | 'status'>[]): Promise<void>;
|
|
9
10
|
aproveReview(id: number): Promise<ProductReviews>;
|
|
10
11
|
disaproveReview(id: number): Promise<ProductReviews>;
|
|
11
12
|
}
|