File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import SignUp from './components/SignUp';
1010import { axiosInstance } from './services/authServices' ;
1111import PostForm from './components/PostForm' ;
1212import PostDetails from './pages/PostDetails' ;
13+ import EditPost from './pages/EditPost' ;
1314// import {getUserFromToken } from './services/userService'
1415
1516const App : React . FC = ( ) => {
@@ -55,7 +56,7 @@ const App : React.FC = () => {
5556 < PostCard
5657 key = { post . id }
5758 title = { post . title }
58- author = { post . author }
59+ author = { post . username }
5960 excerpt = { post . excerpt }
6061 status = { post . status }
6162 published = { post . published }
@@ -77,6 +78,7 @@ const App : React.FC = () => {
7778 < Route exact path = "/posts/:title" >
7879 < PostDetails />
7980 </ Route >
81+
8082 </ Router >
8183 </ >
8284 ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const PostForm : FC<Props> = ({user}) => {
2424 title,
2525 content,
2626 status,
27- author :user ,
27+ username :user ,
2828 excerpt : content . split ( ' ' ) . slice ( 0 , 3 ) . join ( ' ' ) ,
2929 published,
3030 slug : slugiy ( title ) ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const PostDetails = () => {
2121 return (
2222 < >
2323 < h1 > { post ?. title } </ h1 >
24- < small > By { post ?. author } </ small >
24+ < small > By { post ?. username } </ small >
2525 < p > { post ?. content } </ p >
2626 < small > Publication Date: { moment ( post ?. published ) . format ( 'MMMM Do YYYY, h:mm:ss a' ) } </ small >
2727 { post ?. category && < small > Categories: { post ?. category . map ( cat => cat + "," ) } </ small > }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const BASE_URL = 'http://127.0.0.1:8000/api/posts/'
55export interface Post {
66 id ?: number ;
77 title : string ;
8- author : string ;
8+ username : string ;
99 excerpt : string ;
1010 content : string ;
1111 status :string ;
You can’t perform that action at this time.
0 commit comments