SHOW:
|
|
- or go back to the newest paste.
| 1 | - | $scope.getPods = function() {
|
| 1 | + | $scope.getPods = function() {
|
| 2 | - | if ($scope.customers) {
|
| 2 | + | $scope.customer.forEach(customer => {
|
| 3 | - | console.log("Getting pods");
|
| 3 | + | $scope.$http.get(`/lists/pods/${customer.shortname}/ms`).then(response => {
|
| 4 | - | for (i=0; i<$scope.customers.length; i++) {
|
| 4 | + | console.log(`Got back ${response.data.length} pods`);
|
| 5 | - | // FIXME: Check status first |
| 5 | + | }); |
| 6 | - | $http.get("/lists/pods/"+$scope.customers[i]["shortname"]+"/ms").then(function(response){
|
| 6 | + | }); |
| 7 | - | console.log("Got back " + response.data.length + " pods");
|
| 7 | + | } |
| 8 | - | }); |
| 8 | + | |
| 9 | - | } |
| 9 | + | destroy({ commit }, post) {
|
| 10 | - | } |
| 10 | + | return new Promise((resolve, reject) => {
|
| 11 | - | }; |
| 11 | + | Vue.http.delete(`/api/v1/posts/${post.id}`)
|
| 12 | .catch(reject) | |
| 13 | .then(response => {
| |
| 14 | - | If I want that console.log to be |
| 14 | + | commit('destroy', post);
|
| 15 | resolve(response); | |
| 16 | - | "Got back " + response.data.length + " pods for customer " + $scope.customers[i]["shortname"] |
| 16 | + | }); |
| 17 | }); | |
| 18 | - | how can I do that? |
| 18 | + | }, |