Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luhana.blog list #303

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Luhana.blog list #303

wants to merge 3 commits into from

Conversation

ludaze
Copy link

@ludaze ludaze commented Aug 8, 2022

No description provided.

@ludaze ludaze requested a review from TripleThreads August 8, 2022 14:37
@vercel
Copy link

vercel bot commented Aug 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
practice ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 2:39PM (UTC)
practice-project-vue ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 2:39PM (UTC)
practice-vue ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 2:39PM (UTC)

methods: {
...mapActions(['addBlog']),
onSubmit(e) {
e.preventDefault()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; remove this line it is unnecessary

Comment on lines +31 to +32
title: '',
desc: '',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blog: {
  title: '',
  description: ''
}

Comment on lines +40 to +44
this.blogPost = {
title: this.title,
desc: this.desc,
description: 'description',
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; remove this line

desc: this.desc,
description: 'description',
}
this.addBlog(this.blogPost)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.addBlog(this.blog)

Comment on lines +46 to +47
this.title = ''
this.desc = ''
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.clearForm()

@@ -0,0 +1,33 @@
import axios from 'axios'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to import axios. nuxt provides access to axios through this.$axios

export const actions = {
async fetchBlogs({ commit }) {
const response = await axios.get(
'https://blog-app-backend.onrender.com/api/articles/all'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have already set the baseURL in nuxt config. so the relative url is enough. await this.$axios.get('articles/all')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant