Commit 9842ccd2733df85e1a24f54f3fbc3240e2e58129
1 parent
8e25d825bc
Exists in
master
and in
1 other branch
changes api call
Showing
1 changed file
with
53 additions
and
26 deletions
Show diff stats
script.js
... | ... | @@ -170,6 +170,33 @@ |
170 | 170 | } |
171 | 171 | |
172 | 172 | $scope.calculateAmount = function(){ |
173 | + | |
174 | + if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | |
175 | + var x = document.getElementById("snackbar") | |
176 | + x.className = "show"; | |
177 | + setTimeout(function() { | |
178 | + x.className = x.className.replace("show", ""); | |
179 | + }, 3000); | |
180 | + } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | |
181 | + $scope.infoForm = true; | |
182 | + console.log("sdasdasdsa"); | |
183 | + $scope.data.stage = $scope.data.stage; | |
184 | + $scope.detail = {}; | |
185 | + $scope.data.phone = "+91" + $scope.data.number; | |
186 | + $http({ | |
187 | + method: 'POST', | |
188 | + url: BASE_URL + '/applicants', | |
189 | + data: $scope.data, | |
190 | + headers: {} | |
191 | + }).then(function mySuccess(result) { | |
192 | + console.log("result", result) | |
193 | + $scope.detail = result; | |
194 | + data.applicantId = result.data.id; | |
195 | + $scope.userId = result.data.id; | |
196 | + | |
197 | + }, function myError(error) {}); | |
198 | + } | |
199 | + | |
173 | 200 | if ($scope.data.stage == "Idea") { |
174 | 201 | console.log("$scope.data", $scope.data) |
175 | 202 | $scope.ticketAmnt = 500; |
... | ... | @@ -197,30 +224,30 @@ |
197 | 224 | |
198 | 225 | /*****THIS IS FOR STEP THREE FORM ******/ |
199 | 226 | $scope.create = function() { |
200 | - if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | |
201 | - var x = document.getElementById("snackbar") | |
202 | - x.className = "show"; | |
203 | - setTimeout(function() { | |
204 | - x.className = x.className.replace("show", ""); | |
205 | - }, 3000); | |
206 | - } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | |
207 | - $scope.infoForm = true; | |
208 | - console.log("sdasdasdsa"); | |
209 | - $scope.data.stage = $scope.data.stage; | |
210 | - $scope.detail = {}; | |
211 | - $scope.data.phone = "+91" + $scope.data.number; | |
212 | - $http({ | |
213 | - method: 'POST', | |
214 | - url: BASE_URL + '/applicants', | |
215 | - data: $scope.data, | |
216 | - headers: {} | |
217 | - }).then(function mySuccess(result) { | |
218 | - | |
219 | - console.log("=====result=====", result) | |
220 | - $scope.detail = result; | |
221 | - data.applicantId = result.data.id; | |
222 | - $scope.userId = result.data.id; | |
223 | - console.log("=====data=====", data) | |
227 | + // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | |
228 | + // var x = document.getElementById("snackbar") | |
229 | + // x.className = "show"; | |
230 | + // setTimeout(function() { | |
231 | + // x.className = x.className.replace("show", ""); | |
232 | + // }, 3000); | |
233 | + // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | |
234 | + // $scope.infoForm = true; | |
235 | + // console.log("sdasdasdsa"); | |
236 | + // $scope.data.stage = $scope.data.stage; | |
237 | + // $scope.detail = {}; | |
238 | + // $scope.data.phone = "+91" + $scope.data.number; | |
239 | + // $http({ | |
240 | + // method: 'POST', | |
241 | + // url: BASE_URL + '/applicants', | |
242 | + // data: $scope.data, | |
243 | + // headers: {} | |
244 | + // }).then(function mySuccess(result) { | |
245 | + | |
246 | + // console.log("=====result=====", result) | |
247 | + // $scope.detail = result; | |
248 | + // data.applicantId = result.data.id; | |
249 | + // $scope.userId = result.data.id; | |
250 | + // console.log("=====data=====", data) | |
224 | 251 | data.amount = $scope.payingAmnt; |
225 | 252 | if ($scope.detail != null) { |
226 | 253 | $http({ |
... | ... | @@ -280,8 +307,8 @@ |
280 | 307 | }, function myError(error) {}); |
281 | 308 | } |
282 | 309 | |
283 | - }, function myError(error) {}); | |
284 | - } | |
310 | + //}, function myError(error) {}); | |
311 | + //} | |
285 | 312 | |
286 | 313 | } |
287 | 314 | ... | ... |