Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Migrate REST API usage to the Store API #2282

Merged
merged 18 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/js/base/components/reviews/review-list-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function getReviewImage( review, imageType, isLoading ) {
{ imageType === 'product' ? (
<img
aria-hidden="true"
alt=""
src={ review.product_picture || '' }
alt={ review.product_image?.alt || '' }
src={ review.product_image?.src || '' }
className="wc-block-review-list-item__image"
width="48"
height="48"
Expand Down
137 changes: 0 additions & 137 deletions assets/js/base/hocs/test/with-products.js

This file was deleted.

28 changes: 0 additions & 28 deletions assets/js/base/hocs/utils.js

This file was deleted.

115 changes: 0 additions & 115 deletions assets/js/base/hocs/with-products.js

This file was deleted.

6 changes: 3 additions & 3 deletions assets/js/blocks/featured-product/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const FeaturedProduct = ( {
<div
className="wc-block-featured-product__description"
dangerouslySetInnerHTML={ {
__html: product.description,
__html: product.summary,
} }
/>
) }
Expand Down Expand Up @@ -353,11 +353,11 @@ const FeaturedProduct = ( {
<RichText.Content
tagName="a"
className={ buttonClasses }
href={ product.url }
href={ product.permalink }
title={ attributes.linkText }
style={ buttonStyle }
value={ attributes.linkText }
target={ product.url }
target={ product.permalink }
/>
</div>
) : (
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/reviews/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getSortArgs = ( sortValue ) => {
export const getReviews = ( args ) => {
return apiFetch( {
path:
'/wc/blocks/products/reviews?' +
'/wc/store/products/reviews?' +
Object.entries( args )
.map( ( arg ) => arg.join( '=' ) )
.join( '&' ),
Expand Down
Loading