Skip to content

Commit

Permalink
Merge pull request #278 from LL08-MathematicalModelling-dowell/ft-pranai
Browse files Browse the repository at this point in the history
Ft pranai
  • Loading branch information
Pranai-1 authored Jun 10, 2024
2 parents 29bc093 + f3ebd27 commit 05a31d5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pages/scales/report/Booth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function degreesToRadians(degrees) {
return degrees * (Math.PI / 180);
}

console.log(scaleType)

const handleGoButton = async() =>{
setSubmitted(true)
if(boothInput<=0 || isNaN(boothInput))
Expand All @@ -84,9 +84,9 @@ console.log(scaleType)
return
}else{
const response=await axios.get(`https://100035.pythonanywhere.com/addons/register/?shop_number=${boothInput}`)
console.log(response.data.data)

const distance=calculateDistance(latitude,longitude,latitude,longitude)
console.log(distance)


if(distance<=3){
if(scaleType=="nps"){
Expand All @@ -111,16 +111,17 @@ console.log(scaleType)
},[])

async function fetchLocation(){
const response=await axios.get("https://www.qrcodereviews.uxlivinglab.online/api/v6/qrcode-data/22-56d63b0b-5d6c-4d6e-b011-d19a9aa8773b")
const response=await axios.get("https://www.qrcodereviews.uxlivinglab.online/api/v6/qrcode-data/22-71b0c608-ee3d-4b89-b4e4-19f76a6e50ec")
const detailedReport = response.data.response.detailed_report;
console.log(response.data)

if (Array.isArray(detailedReport) && detailedReport.length > 0) {


setLatitude(detailedReport[detailedReport.length - 1].lat+"")
setLongitude(detailedReport[detailedReport.length - 1].long+"")
setLocationLoading(1)
} else {

console.log("detailed_report is either not an array or is empty");
setLocationLoading(-1)
}
Expand Down

0 comments on commit 05a31d5

Please sign in to comment.