This repository was archived by the owner on Mar 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 22 <div >
33
44 <h1 >Your Posts</h1 >
5+
6+ <div class =" dev-stuff" >
7+ Journal ID: {{this.$route.params.id}}
8+ </div >
9+
510 <div id =" posts-container" >
611 <PostCard
712 v-for =" (item, index) in this.allPosts"
813 :key =" index"
9- :card-data =" item.data " />
14+ :card-data =" item" />
1015 </div >
1116
1217 <h2 >Add A New Post</h2 >
2126</template >
2227
2328<script >
24- import {addPost , getPosts , test } from " ../models/PostsModel"
29+ import {addPost , getPosts } from " ../models/PostsModel"
2530import PostCard from " ./PostCard"
2631
2732export default {
@@ -44,7 +49,7 @@ export default {
4449 */
4550 submit () {
4651 console .log (" Post Submitted" , this .post )
47- addPost (this .post )
52+ addPost (this .post , this . $route . params . id )
4853 .then (resp => {
4954 alert (resp .message )
5055 console .log (resp)
@@ -57,13 +62,11 @@ export default {
5762 },
5863 beforeMount () {
5964
60- getPosts ()
65+ getPosts (this . $route . params . id )
6166 .then (resp => {
62- console .log (" data from DB" , resp)
63- this .allPosts = resp
67+ console .log (" posts data from DB" , resp)
68+ this .allPosts = resp . data
6469 })
65-
66- test ()
6770 },
6871};
6972
You can’t perform that action at this time.
0 commit comments