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

delete bug #17

Open
alinaugustin opened this issue Nov 22, 2018 · 1 comment
Open

delete bug #17

alinaugustin opened this issue Nov 22, 2018 · 1 comment

Comments

@alinaugustin
Copy link

When press Delete button the post is deleted even if i choose Cancel.

@escrowdis
Copy link

Add a parameter in function async deletePost (id) will fix it
snippet: 'MEVN-boilerplate/client/src/components/Posts.vue' +58

from

      }).then(function () {
        PostsService.deletePost(id)
        $this.$router.go({
          path: '/'
        })
      })

to

      }).then(function (res) {
        if (res.value) {
          PostsService.deletePost(id)
          $this.$router.go({
            path: '/'
          })
        }
      })

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

No branches or pull requests

2 participants