Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wiegmank committed Apr 21, 2024
1 parent 2bbc62a commit 4f23761
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions ReactFrontEnd/src/Components/ParkDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,19 @@ function ParkDetails() {
//intialize lat/long from Park (not "addresses")
const latlong = [Number(parkInfo.latitude), Number(parkInfo.longitude)];

// console.log("CONTACTS")
//initializes phone # for contact info
const phone = parkInfo.contacts.phoneNumbers[0].phoneNumber;


let newPhone = "";
//template for phone number formatting
let newPhone = "(xxx) xxx-xxxx";

//parses unformatted phone numbers
if (phone.length > 10) {
newPhone = phone;
} else {

//template for phone number formatting
let newPhone = "(xxx) xxx-xxxx";

if (phone.length == 10) {
for (let i = 0; i < phone.length; i++) {
newPhone = newPhone.replace("x", phone[i]);
}
} else {
newPhone = phone;
}

//initializes collection of addresses
Expand Down
2 changes: 1 addition & 1 deletion ReactFrontEnd/src/Services/GlobalAPI.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const getParkInfoURL="https://developer.nps.gov/api/v1/parks?parkCode="
const api_key=import.meta.env.VITE_REACT_APP_NPS_API_KEY;

//finds x # ('num') of pictures by string ('searchTerm')
let searchTerm = 'scenic';
let searchTerm = 'overlook';
let num = 10;
const getImages=axios.get(parkBaseURL+"/multimedia/galleries/assets?limit="+num+"&q="+searchTerm+"&api_key="+api_key);

Expand Down

0 comments on commit 4f23761

Please sign in to comment.