load feeds
This commit is contained in:
parent
9828df74f1
commit
e80aca5e60
@ -1,3 +1,21 @@
|
||||
// Fetch and display feeds
|
||||
async function fetchFeeds() {
|
||||
try {
|
||||
const response = await fetch('/feeds');
|
||||
if (response.ok) {
|
||||
const feeds = await response.json();
|
||||
console.log('Feeds loaded:', feeds);
|
||||
} else {
|
||||
console.error('Failed to load feeds:', response.status);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading feeds:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Load feeds when page loads
|
||||
document.addEventListener('DOMContentLoaded', fetchFeeds);
|
||||
|
||||
// Logout functionality
|
||||
document.getElementById('logoutButton').addEventListener('click', async () => {
|
||||
try {
|
||||
@ -82,9 +100,8 @@ confirmButton.addEventListener('click', async () => {
|
||||
|
||||
if (response.ok) {
|
||||
hideModal();
|
||||
// TODO: Update the feed list in the UI
|
||||
// For now, we'll just reload the page
|
||||
window.location.reload();
|
||||
// Refresh the feed list
|
||||
fetchFeeds();
|
||||
} else {
|
||||
switch (response.status) {
|
||||
case 409:
|
||||
|
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<h2>Navigation</h2>
|
||||
<h2>Feeds</h2>
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/message">Message</a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user