Skip to content

Commit

Permalink
123
Browse files Browse the repository at this point in the history
  • Loading branch information
afeezaziz committed Jul 6, 2024
1 parent a5aa59b commit 29ddaa2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ function App() {

const sendClickCountToAPI = useCallback(async () => {
try {
await axios.post('https://webhook.site/bd11b5a9-a2b5-45a2-af5a-09b10cf85ced', { clickCount });
console.log('Click count sent to API');
const data = {
clickCount: clickCount,
// Add any other relevant data here
userAddress: userAddress || 'Not connected',
timestamp: new Date().toISOString()
};

const response = await axios.post('https://apedex.online/app/update-clicks', data, {
headers: {
'Content-Type': 'application/json'
}
});

console.log('Click count sent to API', response.data);
} catch (error) {
console.error('Error sending click count to API:', error);
}
}, [clickCount]);
}, [clickCount, userAddress]);

useEffect(() => {
const config = {
Expand Down

0 comments on commit 29ddaa2

Please sign in to comment.