Delete Confirm Modal with State Vars
Fullstack Social iOS NodeJS REST
In this lesson, I'd like to take some time to discuss building out a confirm modal whenever the user hits the delete button. Whenever you are building out UI that performs a destructive operation, it's always a good idea to make sure the user can confirm their actions. The way we'll get this working is through a simple state variable using Vue.js. Enjoy.

Comments (4)
Majid Boudaoud
3 years ago
Hey Brian, I've been looking around for some time, didn't find anything about uploading multiple files to s3 at once using Sails.js, could you help me with that ?
Majid Boudaoud
3 years ago
Desperately getting a "EMAXBUFFER: An upstream <FileName> timed out before it was plugged into a receiver." when trying to upload more than one file. See -> https://github.com/balderdashy/sails/issues/4914#issuecomment-508334147
Brian Voong
3 years ago
AlfieLBTA
3 years ago
Hey Brian once implemented the confirmDelete Method with the ID coming from the vue data: this.posts = this.posts.filter(p => { return p.id != this.selectedPostToDelete }); It started refreshing the page but with the post still there , i need to reload in order for it to not render , Note: im passing the id directly -- v-on:click"deletePost(p.id)" -- instead of the whole post as you did.
AlfieLBTA
3 years ago
Lol , hen i implemented the create one started working again.
Brian Voong
3 years ago
Danny S
3 years ago
hi Brian, there's a bug when you login, the controller redirect to /post and at the first time the confirmation modal will be displayed for half sec. and it disappear automatically. it will happen when you refresh the page.
Danny S
3 years ago
sorry, v-cloak resolved issue.
gerkov77
3 years ago
Hey Brian, Fantastic course! I did my homework (stuck a little bit with the actual axios creation, but there I had your download materials to help me out fortunately). One strange error message comes up on the Safari browsers Js-console (on Brave browser the same error message comes up as a yellow warning): [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (bootstrap.bundle.js.map, line 0) Everything works fine though ! But those red things always bother me. I tried to search on the net, where they were talking about modifying the paths for these files to start with ../ , but I have no idea where these files should come from, and what their role is, where their access should be set - are they important actually?
HELP & SUPPORT