Skip to content

Commit aabfd6b

Browse files
committed
fixes check
1 parent a714763 commit aabfd6b

11 files changed

+86
-78
lines changed

client/build/asset-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"main.js": "static/js/main.c7ca716a.js",
3-
"main.js.map": "static/js/main.c7ca716a.js.map"
2+
"main.js": "static/js/main.a05c209c.js",
3+
"main.js.map": "static/js/main.a05c209c.js.map"
44
}

client/build/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,400italic,700"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Patua+One:100,300,400,400italic,700"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:300,400,400italic,500,600,700,700italic,900"><link rel="stylesheet" href="/style.css"><link rel="stylesheet" href="/css/global.css"><link rel="stylesheet" href="/css/structure.css"><link rel="stylesheet" href="/css/blogfeed.css"><link rel="stylesheet" href="/css/custom.css"><link rel="stylesheet" href="/css/materialize.css"><title>BlogFeed</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="./js/jquery-2.1.4.min.js"></script><script src="./js/mfn.menu.js"></script><script src="./js/jquery.plugins.js"></script><script src="./js/jquery.jplayer.min.js"></script><script src="./js/animations/animations.js"></script><script src="./js/translate3d.js"></script><script src="./js/scripts.js"></script><script type="text/javascript" src="/static/js/main.c7ca716a.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,400italic,700"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Patua+One:100,300,400,400italic,700"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:300,400,400italic,500,600,700,700italic,900"><link rel="stylesheet" href="/style.css"><link rel="stylesheet" href="/css/global.css"><link rel="stylesheet" href="/css/structure.css"><link rel="stylesheet" href="/css/blogfeed.css"><link rel="stylesheet" href="/css/custom.css"><link rel="stylesheet" href="/css/materialize.css"><title>BlogFeed</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="./js/jquery-2.1.4.min.js"></script><script src="./js/mfn.menu.js"></script><script src="./js/jquery.plugins.js"></script><script src="./js/jquery.jplayer.min.js"></script><script src="./js/animations/animations.js"></script><script src="./js/translate3d.js"></script><script src="./js/scripts.js"></script><script type="text/javascript" src="/static/js/main.a05c209c.js"></script></body></html>

client/build/service-worker.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/js/main.a05c209c.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/js/main.a05c209c.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/js/main.c7ca716a.js

-2
This file was deleted.

client/build/static/js/main.c7ca716a.js.map

-1
This file was deleted.

client/src/components/Landing.js

+75-68
Original file line numberDiff line numberDiff line change
@@ -18,83 +18,90 @@ class Landing extends Component {
1818

1919
renderBlogs() {
2020
return map(this.props.blogs, (blog) => {
21-
return (
22-
<div
23-
key={v4()}
24-
className="post-item isotope-item clearfix post-45 post type-post status-publish format-standard has-post-thumbnail hentry category-adventures"
25-
>
26-
<div className="date_label">{blog.createdAt}</div>
27-
<div style={{ cursor: 'pointer' }} className="button-love">
28-
<span onClick={() => this.clickHandler(blog._id)} className="mfn-love " data-id={45}>
29-
<span className="icons-wrapper">
30-
<i className="icon-heart-empty-fa" />
31-
<i className="icon-heart-fa" />
32-
</span>
33-
<span className="label">{blog.likesCount}</span>
34-
</span>
35-
</div>
36-
<Link to={`/blogs/${blog._id}`}>
37-
<div className="image_frame post-photo-wrapper scale-with-grid images_only">
38-
<div className="image_wrapper">
39-
<div className="mask" />
40-
<img
41-
src={`${blog.imageUrl}`}
42-
className="scale-with-grid wp-post-image"
43-
alt=""
44-
/>
45-
</div>
46-
</div>
47-
</Link>
48-
49-
<Link to={`/blogs/${blog._id}`}>
50-
21+
try {
22+
return (
5123
<div
52-
className="post-desc-wrapper bg-dark"
53-
style={{ backgroundColor: "#505b4e" }}
24+
key={v4()}
25+
className="post-item isotope-item clearfix post-45 post type-post status-publish format-standard has-post-thumbnail hentry category-adventures"
5426
>
55-
<div className="post-desc">
56-
<div className="post-head">
57-
<div className="post-meta clearfix">
58-
<div className="category">
59-
<span className="cat-btn">
60-
Categories <i className="icon-down-dir" />
61-
</span>
62-
<div className="cat-wrapper">
63-
<ul className="post-categories">
64-
<li>
65-
<span>
66-
Public
67-
</span>
68-
</li>
69-
</ul>
27+
<div className="date_label">{blog.createdAt}</div>
28+
<div style={{ cursor: 'pointer' }} className="button-love">
29+
<span onClick={() => this.clickHandler(blog._id)} className="mfn-love " data-id={45}>
30+
<span className="icons-wrapper">
31+
<i className="icon-heart-empty-fa" />
32+
<i className="icon-heart-fa" />
33+
</span>
34+
<span className="label">{blog.likesCount}</span>
35+
</span>
36+
</div>
37+
<Link to={`/blogs/${blog._id}`}>
38+
<div className="image_frame post-photo-wrapper scale-with-grid images_only">
39+
<div className="image_wrapper">
40+
<div className="mask" />
41+
<img
42+
src={`${blog.imageUrl}`}
43+
className="scale-with-grid wp-post-image"
44+
alt=""
45+
/>
46+
</div>
47+
</div>
48+
</Link>
49+
50+
<Link to={`/blogs/${blog._id}`}>
51+
52+
<div
53+
className="post-desc-wrapper bg-dark"
54+
style={{ backgroundColor: "#505b4e" }}
55+
>
56+
<div className="post-desc">
57+
<div className="post-head">
58+
<div className="post-meta clearfix">
59+
<div className="category">
60+
<span className="cat-btn">
61+
Categories <i className="icon-down-dir" />
62+
</span>
63+
<div className="cat-wrapper">
64+
<ul className="post-categories">
65+
<li>
66+
<span>
67+
Public
68+
</span>
69+
</li>
70+
</ul>
71+
</div>
7072
</div>
7173
</div>
7274
</div>
73-
</div>
74-
<div className="post-title">
75-
<h2 className="entry-title">
76-
{blog.title}
77-
</h2>
78-
</div>
79-
<div className="post-excerpt">{blog.content}</div>
80-
<div className="post-footer">
81-
<span className="vcard author post-author">
82-
<img
83-
alt={blog._user.displayName}
84-
src={`${blog._user.photoUrl}`}
85-
className="post-date updated" referrerPolicy="no-referrer" width={'40px'}
86-
/> By {blog._user.displayName},
87-
88-
On &nbsp;
89-
{new Date(blog.createdAt).toLocaleDateString('en-us', { weekday:"long", year:"numeric", month:"short", day:"numeric"})}
90-
</span>
75+
<div className="post-title">
76+
<h2 className="entry-title">
77+
{blog.title}
78+
</h2>
79+
</div>
80+
<div className="post-excerpt">{blog.content}</div>
81+
<div className="post-footer">
82+
<span className="vcard author post-author">
83+
<img
84+
alt={blog._user.displayName}
85+
src={`${blog._user.photoUrl}`}
86+
className="post-date updated" referrerPolicy="no-referrer" width={'40px'}
87+
/> By {blog._user.displayName},
88+
89+
On &nbsp;
90+
{new Date(blog.createdAt).toLocaleDateString('en-us', { weekday:"long", year:"numeric", month:"short", day:"numeric"})}
91+
</span>
92+
</div>
9193
</div>
9294
</div>
95+
</Link>
96+
9397
</div>
94-
</Link>
98+
);
99+
} catch (error) {
100+
return (
101+
"You are seeing cached data please reload"
102+
);
103+
}
95104

96-
</div>
97-
);
98105
});
99106
}
100107

client/src/components/blogs/BlogList.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import map from 'lodash/map';
33
import { connect } from 'react-redux';
44
import { Link } from 'react-router-dom';
55
import { fetchBlogs } from '../../actions';
6+
import { v4 } from "uuid";
67

78
class BlogList extends Component {
89
componentDidMount() {
@@ -12,7 +13,7 @@ class BlogList extends Component {
1213
renderBlogs() {
1314
return map(this.props.blogs, blog => {
1415
return (
15-
<div className="card darken-1 horizontal m-2" key={blog._id}>
16+
<div className="card darken-1 horizontal m-2" key={v4()}>
1617
<div className="card-stacked">
1718
<div className="card-content">
1819
<span className="card-title">{blog.title}</span>

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"scripts": {
1010
"start": "node index.js",
11-
"server": "nodemon index.js --ignore tests",
11+
"server": "forever start index.js",
1212
"client": "npm run start --prefix client",
1313
"dev": "concurrently \"npm run server\" \"npm run client\"",
1414
"build": "NPM_CONFIG_PRODUCTION=false npm install --legacy-peer-deps --prefix client && npm run build --prefix client",
@@ -26,6 +26,7 @@
2626
"cookie-session": "2.0.0-beta.2",
2727
"cors": "^2.8.5",
2828
"express": "4.15.3",
29+
"forever": "^4.0.3",
2930
"jest": "23.6.0",
3031
"migrate-mongoose": "3.2.2",
3132
"mongoose": "5.10.11",

routes/blogRoutes.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const Blog = mongoose.model('Blog');
77
module.exports = app => {
88
app.get('/api/blogs/:id', requireLogin, async (req, res) => {
99
const blog = await Blog.findOne({
10-
_user: req.user.id,
1110
_id: req.params.id
1211
});
1312

0 commit comments

Comments
 (0)