updated axios urls

This commit is contained in:
z0ccc 2021-07-27 15:59:35 -04:00
parent 6e0223ed5c
commit d9004280f6
2 changed files with 9 additions and 8 deletions

View file

@ -2,7 +2,6 @@
"name": "vytal", "name": "vytal",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"proxy": "http://localhost:8000",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-pro": "^5.15.3", "@fortawesome/fontawesome-pro": "^5.15.3",
"@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/fontawesome-svg-core": "^1.2.35",

View file

@ -10,17 +10,19 @@ const FingerprintBlock = () => {
const [display, setDisplay] = useState('none'); const [display, setDisplay] = useState('none');
useEffect(() => { useEffect(() => {
axios.get(`/fingerprint/?hash=${hash}`).then((response) => { axios
if (response.data.length !== 0) { .get(`http://localhost:8000/fingerprint/?hash=${hash}`)
setName(response.data[response.data.length - 1].name); .then((response) => {
} if (response.data.length !== 0) {
setDisplay('block'); setName(response.data[response.data.length - 1].name);
}); }
setDisplay('block');
});
}, []); }, []);
const handleSave = (e) => { const handleSave = (e) => {
e.preventDefault(); e.preventDefault();
axios.post('/fingerprint/', { axios.post('http://localhost:8000/fingerprint/', {
name: e.target[0].value, name: e.target[0].value,
hash, hash,
}); });