Skip to content

Commit dc8a2c2

Browse files
nested api removed
1 parent 9909b95 commit dc8a2c2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/CreatePost.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ const CreatePost = ({classes,editMode,match:{params:{id}},history:{goBack,push}}
6464
const [hasLiked,setHasLiked] = useState(false);
6565
const {text,createdAt,like} = state;
6666
const params = {
67-
url: editMode ? `/post/update/${id}` : "/post/create",
67+
url: editMode ? `/update/${id}` : "/create",
6868
method: editMode ? "put" : "post",
6969
}
7070

7171
useEffect(()=>{
7272
if(editMode){
7373
callAPi({
74-
url:`/post/listing?id=${id}`,
74+
url:`/listing?id=${id}`,
7575
method:'get',
7676
}).then((result)=>{
7777
if(result.status=== 200){

src/components/PostListing.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const PostListing = ({ history:{push}}) => {
179179
const [postList, setPostList] = useState([]);
180180
const [open,setDialog] = useState(false);
181181
const params = {
182-
url: '/post/listing',
182+
url: '/listing',
183183
method: "get",
184184
}
185185

src/server/api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ router.route('/update/:id').put(updatePost).delete(deletePost);
1111

1212

1313
export default app => {
14-
app.use('/post', router);
14+
app.use(router);
1515
};

0 commit comments

Comments
 (0)