Skip to content

Commit

Permalink
Merge pull request #33 from Crudzaso/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DiegoAndresRamirez authored Nov 4, 2024
2 parents 0d41908 + 2750a0f commit 14ddeea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion resources/js/Pages/LotteryResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ const cardStyle = computed(() => ({
const fetchLotteryResults = async () => {
try {
const response = await fetch('https://apilotteries.onrender.com/api/lotteries');
const response = await fetch('https://apilotteries.onrender.com/api/lotteries', {
method: 'GET',
headers: {
'Authorization': `Bearer ${import.meta.env.VITE_TOKEN_LOTTERIES_API}`
}
});
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
lotteryResults.value = data.data.slice(0, 11).map(lottery => ({
name: lottery.firstH1,
Expand All @@ -44,6 +54,8 @@ const fetchLotteryResults = async () => {
}
};
onMounted(() => {
fetchLotteryResults();
});
Expand Down

0 comments on commit 14ddeea

Please sign in to comment.