Guest User

Untitled

a guest
Jan 21st, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <input id="brief" type="file" @change="processFile($event)" class="">
  2. <div @click="nextRoute()" class="btn" :class="{'btn--primary': project !== '', 'btn--disabled': project == '' || project == '<p><br></p>',}">Next</div>
  3.  
  4. nextRoute () {
  5.  
  6. let $this = this;
  7.  
  8. const fd = new FormData();
  9. fd.append('file', this.file, this.fileName);
  10. fd.append('project', this.project);
  11.  
  12. this.$axios.post(process.env.apiURL+'/api/contact/submission/project/'+submission, fd, {
  13. headers: {
  14. 'Content-Type': 'multipart/form-data'
  15. }
  16. })
  17. .then(function (response) {
  18. if ($this.error.file == null && $this.error.project == null){
  19. TweenMax.to("#stageFive", 0.5, {opacity:0, y:-100, delay:0, ease:Back, force3D:true}, 0.2);
  20. localStorage.stage = 6;
  21. setTimeout(function(){
  22. $this.$router.push({path:'/start-project/complete'})
  23. }, 500);
  24. }
  25. })
  26. .catch(function (error) {
  27. if(error.response) {
  28. $this.error = error.response.data.errors;
  29. }
  30. });
  31. },
  32. processFile(event) {
  33. this.file = event.target.files[0]
  34. this.fileName = event.target.files[0].name
  35. },
Add Comment
Please, Sign In to add comment