Commit 1b560a14 authored by Bianca-Mihaela Ganescu's avatar Bianca-Mihaela Ganescu
Browse files

Tried sending user track data to server, blocked [BG, IK]

parent cb66f961
Pipeline #203792 passed with stage
in 54 seconds
{
"projects": [
"track": [
{
"name": "Eco Warriors",
"status": "In Progress",
"desc": "To be or not to be that is the question",
"id": 2
},
{
"name": "Braille Machine",
"desc": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"status": "Available",
"id": 6
"project_id": "112",
"date": 1623853746081,
"id": 1
},
{
"name": "My new project",
"desc": "Add some awesome description!",
"status": "Completed",
"id": 7
"project_id": "78",
"date": 1623853765672,
"id": 2
}
]
}
\ No newline at end of file
......@@ -10,9 +10,28 @@ const ProjectDetails = () => {
const { data: project, error, isPending } = useFetch("/projects/" + id)
const { data: assignments, errorAssignment, isPendingAssignment } = useFetch("/user_project/" + id)
const { trackEvent } = useTracking({}, { dispatch: data => console.log(data) })
const { trackEvent } = useTracking({}, { dispatch: data => writeToLink(data) })
function writeToLink (dataToWrite){
fetch('https://drp-inaglobe-platform.herokuapp.com/track' ,{
method: 'POST',
headers: {"Content-Type": "application/json"},
body: JSON.stringify(dataToWrite)
})
}
const handleTrack = e => {
trackEvent(
{project_id: id,
date: Date.now()
}
)
e.preventDefault()
};
const handleRemove = e => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment