-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): add product review client's method (#1233)
* feat(client): add product review * feat(client): expose more method for docs
- Loading branch information
Showing
67 changed files
with
1,641 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
docs/landing/resources/api/shopware-6-client.addproductreview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/shopware-6-client](./shopware-6-client.md) > [addProductReview](./shopware-6-client.addproductreview.md) | ||
|
||
## addProductReview() function | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
Add a review to specific product by its ID | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function addProductReview(productId: string, productReviewData: { | ||
title: string; | ||
content: string; | ||
points: number; | ||
}, contextInstance?: ShopwareApiInstance): Promise<void>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| productId | string | | | ||
| productReviewData | { title: string; content: string; points: number; } | | | ||
| contextInstance | [ShopwareApiInstance](./shopware-6-client.shopwareapiinstance.md) | | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<void> | ||
|
||
## Exceptions | ||
|
||
ClientApiError | ||
|
34 changes: 34 additions & 0 deletions
34
docs/landing/resources/api/shopware-6-client.addpromotioncode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/shopware-6-client](./shopware-6-client.md) > [addPromotionCode](./shopware-6-client.addpromotioncode.md) | ||
|
||
## addPromotionCode() function | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
Adds new promotion code to the cart by its code. | ||
|
||
Promotion code is being added as separate cart item line. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function addPromotionCode(promotionCode: string, contextInstance?: ShopwareApiInstance): Promise<Cart>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| promotionCode | string | | | ||
| contextInstance | [ShopwareApiInstance](./shopware-6-client.shopwareapiinstance.md) | | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<Cart> | ||
|
||
## Exceptions | ||
|
||
ClientApiError | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/shopware-6-client](./shopware-6-client.md) > [clearCart](./shopware-6-client.clearcart.md) | ||
|
||
## clearCart() function | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
When no sw-context-token given then this method return an empty cart with the new sw-context-token. | ||
|
||
When sw-context-token given then this method simply returns the current state of the cart. | ||
|
||
As the purpose of this method is not clear we recommend to use `getCart` method because its behaviour seems to be the same. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function clearCart(contextInstance?: ShopwareApiInstance): Promise<ContextTokenResponse>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| contextInstance | [ShopwareApiInstance](./shopware-6-client.shopwareapiinstance.md) | | | ||
|
||
<b>Returns:</b> | ||
|
||
Promise<ContextTokenResponse> | ||
|
||
## Exceptions | ||
|
||
ClientApiError | ||
|
Oops, something went wrong.
f6bda11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: