diff --git a/starter-project-web-vue2/components/amsale/AmsaleBlogList.vue b/starter-project-web-vue2/components/amsale/AmsaleBlogList.vue
index a399cf00..3f46bcca 100644
--- a/starter-project-web-vue2/components/amsale/AmsaleBlogList.vue
+++ b/starter-project-web-vue2/components/amsale/AmsaleBlogList.vue
@@ -28,7 +28,7 @@
-
+
mdi-pencil
Edit
@@ -55,6 +55,13 @@ export default {
show: false,
updatedBlog: {},
}),
+ computed: {
+ isAuthor() {
+ return this.$auth.loggedIn && this.blog.authorUserId
+ ? this.blog.authorUserId._id === this.$auth.user._id
+ : 'loading'
+ },
+ },
created() {
this.updatedBlog.title = this.blog.title
@@ -63,9 +70,7 @@ export default {
methods: {
...mapActions('amsale', ['editBlog']),
onSave() {
- console.log('from frontend', this.blog, this.$auth.user)
this.editBlog({ blog: this.updatedBlog, id: this.blog._id })
- // this.$nuxt.refresh()
this.snackbar = true
window.location.reload()
this.show = false
diff --git a/starter-project-web-vue2/store/amsale.js b/starter-project-web-vue2/store/amsale.js
index eb0855da..1c179ea0 100644
--- a/starter-project-web-vue2/store/amsale.js
+++ b/starter-project-web-vue2/store/amsale.js
@@ -7,7 +7,6 @@ const actions = {
commit('setBlogs', response.data)
},
async deleteBlog({ commit }, id) {
- console.log('deleted id', id)
await this.$axios.delete(`articles/${id}`)
commit('deletedBlog', id)
window.location.reload()
@@ -17,7 +16,6 @@ const actions = {
commit('newBlog', response.data)
},
async editBlog({ commit }, { blog, id }) {
- console.log(blog, id)
const response = await this.$axios.patch(`articles/${id}`, blog)
commit('editBlog', response.data)
},