Skip to content

Commit

Permalink
Fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
potato4d committed Jan 5, 2019
1 parent 74a622a commit 4556ff5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/nuxt-blog-service/app/store/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export const actions = {
},
async publishPost({ commit }, { payload }) {
const user = await this.$axios.$get(`/users/${payload.user.id}.json`)
const post_id = (await this.$axios.$post('/posts.json', payload)).name
const created_at = moment().format()
payload = {
created_at,
...payload
}
const post_id = (await this.$axios.$post('/posts.json', payload)).name
const post = { id: post_id, ...payload, created_at }
const putData = { id: post_id, ...payload, created_at }
delete putData.user
Expand Down

0 comments on commit 4556ff5

Please sign in to comment.