My front end
import {getCryptoCurrencyInfo} from ‘backend/serviceModule’ ;
//
$w.onReady( function () {
// TODO: write your page related code here…
});
export function button1_click(event) {
// Add your code for this event here:
console.log( "Retrieving information for " + $w( “#currencyInput” ).value);
$w( “#result” ).text = "Retrieving information for " + $w( “#currencyInput” ).value;
getCryptoCurrencyInfo($w( “#currencyInput” ).value)
.then(currencyInfo => {
$w( “#result” ).text = "Name: " + currencyInfo[ 0 ].name + “\n”
+ "Symbol: " + currencyInfo[ 0 ].symbol + “\n”
+ "Price: " + currencyInfo[ 0 ].price + “\n”
+ "Volume: " + currencyInfo[ 0 ].volume;
});
}
My backend
import {fetch} from ‘wix-fetch’ ;
export function getCryptoCurrencyInfo(currency) {
const url = ‘URL HERE/’ + currency + ‘?apikey=mykey’ ;
console.log( "Url: " + url);
return fetch(url, {method: ‘get’ })
.then(response => response.json())
}
The url for the API requires my search bar input to be all capital letters or else the search will not work. How to I get the input to be all capital letters for the output regardless of what case the input is in?