Skip to content

Commit

Permalink
test 6
Browse files Browse the repository at this point in the history
  • Loading branch information
KostiantynFandeliuk committed Dec 6, 2024
1 parent d801bde commit e882ffa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions blocks/commerce-create-return/commerce-create-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import '../../scripts/initializers/order.js';

export default async function decorate(block) {
await orderRenderer.render(CreateReturn, {
routeReturnSuccess: (orderData) => (checkIsAuthenticated() ? `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderData.number}` : `${ORDER_DETAILS_PATH}?orderRef=${orderData.token}`),
routeReturnSuccess: (orderData) => {
const orderRef = checkIsAuthenticated() ? orderData.number : orderData.token;
const encodedOrderRef = encodeURIComponent(orderRef);
const path = checkIsAuthenticated() ? CUSTOMER_ORDER_DETAILS_PATH : ORDER_DETAILS_PATH;

return `${path}?orderRef=${encodedOrderRef}`;
},
})(block);
}
}

Check failure on line 21 in blocks/commerce-create-return/commerce-create-return.js

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

0 comments on commit e882ffa

Please sign in to comment.