Skip to content

Commit

Permalink
Merge pull request #265 from LL08-MathematicalModelling-dowell/fronte…
Browse files Browse the repository at this point in the history
…nd-Norah

Frontend norah
  • Loading branch information
norahwinda authored Jun 4, 2024
2 parents 7c128b6 + e66dd9d commit 6ba1a87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/scales/report/Booth.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import React from 'react'
import { useState, useEffect} from 'react';
import { Link, useParams, useSearchParams } from "react-router-dom";
import { useLocation } from "react-router-dom";

const Booth = () => {

const [boothInput, setBoothInput] = useState()
const {slug}=useParams()
console.log(slug)
const search = useLocation().search;
const scale_id =new URLSearchParams(search).get("scale_id");
const workspace_id =new URLSearchParams(search).get("workspace_id");
const username =new URLSearchParams(search).get("username");
const chanelName =new URLSearchParams(search).get("channel_name");
const [searchParams, setSearchParams] = useSearchParams();
console.log(searchParams.get("scale_id"))
let currentUrlParams = new URLSearchParams(window.location.search);
Expand All @@ -24,7 +30,7 @@ const Booth = () => {
<h3 className='mt-[140px]'>Please enter your booth number</h3>
<input name='boothInput' value={boothInput} onChange={(e) =>setBoothInput(e.target.value)} type='number' className='w-[150px] h-[30px] border-2 border-black mt-5' />
<button className='w-[70px] h-[30px] rounded-lg mt-[100px] bg-[#FEC39C]'
onClick={handleGoButton}><Link to="http://127.0.0.1:8000/nps-lite/api/v5/nps-lite-create-scale/?user=True&scale_type=nps_lite&workspace_id=65b8d6f13d801280ffe56d65&username=Paolo&scale_id=665ed61fa746caf0d6d407c9&channel_name=channel_1">Go</Link></button>
onClick={handleGoButton}><Link to={`https://100035.pythonanywhere.com/nps-lite/api/v5/nps-lite-create-scale/?user=False&scale_type=nps_lite&workspace_id=${workspace_id}&username=${username}&scale_id=${scale_id}&channel_name=${chanelName}&instance_id=${boothInput}`}>Go</Link></button>
</div>
)
}
Expand Down

0 comments on commit 6ba1a87

Please sign in to comment.