Advertisement
3gsxarakiri

Untitled

Jan 28th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let app = new Vue({
  2.     el: '#app',
  3.     data: {
  4.         stage: 'start',
  5.         inspection: null,
  6.         stagesData: {
  7.             inspection : {
  8.                 currentUser : null,
  9.             },
  10.         },
  11.     },
  12.  
  13.     methods : {
  14.  
  15.         retrieveUser: function (params) {
  16.             this.stagesData.inspection.currentUser = this.stagesData.list.users.shift();
  17.             this.stagesData.inspection.currentUser.link = `link here`;
  18.             this.stagesData.inspection.currentUser.products = [];
  19.             $.ajax({
  20.                 type: "get",
  21.                 url: "/api/utilities/check/inspection/users/products",
  22.                 data: {
  23.                     uid: this.stagesData.inspection.currentUser.partner.uid,    
  24.                 },
  25.                 success: function (response) {
  26.                     let products = JSON.parse(response);
  27.                     products.forEach(function (item) {
  28.                         app.stagesData.inspection.currentUser.products.push(item);
  29.                     })
  30.                 }
  31.             });
  32.         }
  33.     },
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement