Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
augustosalazar committed Nov 5, 2024
1 parent 8a108df commit 0da3265
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ document.getElementById('get-users-form').addEventListener('submit', async (even
}
});


const users = await response.json();
if (!response.ok) {
throw new Error(result.detail || 'Error fetching users');
throw new Error(users.detail || 'Error fetching users');
}

document.getElementById('users-list').innerText = JSON.stringify(users);
Expand Down

0 comments on commit 0da3265

Please sign in to comment.