Skip to content

Commit

Permalink
Update eula.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
AyeZeeBB authored Dec 24, 2023
1 parent 0322744 commit aada0e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/eula.astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@ import Layout from "../layouts/Layout.astro";
body: JSON.stringify(postData), // Convert the data to JSON format
};

// Make the POST request using fetch
fetch(url, options)
.then(response => response.json()) // Assuming the response is in JSON format
.then(data => {
// Insert the response into the <p> element
// Extract the "contents" value from the response
const contents = data?.data?.contents;

// Insert the "contents" into the <p> element
const responseParagraph = document.getElementById('responseParagraph');
responseParagraph.textContent = JSON.stringify(data, null, 2); // Displaying the JSON response with indentation
responseParagraph.textContent = contents || 'No contents found';
})
.catch(error => {
console.error('Error:', error);
});

});
</script>

Expand Down

0 comments on commit aada0e1

Please sign in to comment.