From 2c26aab8cc262803353d89d6da71d7280c63d206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 12:20:36 +0200 Subject: [PATCH] add exception for loaning a piece for ikonotv --- js/components/ascribe_detail/piece_container.js | 5 ++++- js/components/whitelabel/wallet/constants/wallet_api_urls.js | 4 ++-- js/components/whitelabel/wallet/wallet_routes.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 3739a508..2c6da4a9 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -84,8 +84,11 @@ let PieceContainer = React.createClass({ IT SHOULD BE REMOVED AND REPLACED WITH A BETTER SOLUTION ASAP! + ALSO, WE ENABLED THE LOAN BUTTON FOR IKONOTV TO LET THEM LOAN ON A PIECE LEVEL + */ - if(state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { + let subdomain = window.location.host.split('.')[0]; + if(subdomain !== 'ikonotv' && state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { let pieceState = mergeOptions({}, state.piece); pieceState.acl.acl_loan = false; diff --git a/js/components/whitelabel/wallet/constants/wallet_api_urls.js b/js/components/whitelabel/wallet/constants/wallet_api_urls.js index 22d4017e..c1b101a1 100644 --- a/js/components/whitelabel/wallet/constants/wallet_api_urls.js +++ b/js/components/whitelabel/wallet/constants/wallet_api_urls.js @@ -13,8 +13,8 @@ function getWalletApiUrls(subdomain) { } else if (subdomain === 'ikonotv'){ return { - 'pieces_list': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/', - 'piece': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/${piece_id}/' + 'pieces_list': walletConstants.walletApiEndpoint + subdomain + '/pieces/', + 'piece': walletConstants.walletApiEndpoint + subdomain + '/pieces/${piece_id}/' }; } return {}; diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 9532299c..ec5b9787 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -74,7 +74,7 @@ let ROUTES = { - +