Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions orbit-app/src/pages/BlogsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ function BlogsPage() {
const [title, setTitle] = useState('');
const [content, setContent] = useState('');

useEffect(() => {
() => {
// Fetching all blogs
axios.get(`${BASE_URL}/blogs`)
.then((res) => {
setBlogs(res.data);
})
.catch((err) => {
console.error('Error fetching blogs:', err.response.data);
console.error('Error fetching blogs:', err.message); // FIX: Log only the error message to avoid exposing sensitive data
});
}, []);
}

const handleCreateBlog = () => {
axios.post(`${BASE_URL}/blogs/create`, {
Expand Down