Skip to content

Commit fa20a31

Browse files
author
Jon Myrick
authored
Merge pull request CodewarsClone#52 from CodewarsClone/wedBranch6
Wed branch6
2 parents 747053c + 7e2f467 commit fa20a31

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/mainService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ angular.module('app').service('mainService', function($http, $q, $sce) {
88
// this.user = {id: 4, github_id: "20197415", name: "Steven", email: null, picture_url: "https://avatars.githubusercontent.com/u/20197415?v=3", username: "Steven-Nagie"};
99
this.user = {};
1010

11+
//this.currentKataId = {}
12+
1113
// POST
1214
this.testExamples = (solution, examples) => {
1315
return $http({
@@ -30,7 +32,7 @@ angular.module('app').service('mainService', function($http, $q, $sce) {
3032
});
3133
};
3234

33-
this.setSolution = (solution, kataid) => {
35+
this.submitAnswer = (solution, kataid, userid) => {
3436
return $http({
3537
method: 'POST',
3638
url: `/api/solution/` + kataid,

src/components/training/trainingCtrl.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ angular.module('app').controller('trainingCtrl', function($scope, $state, mainSe
7979
// mainService.testSuite(solutions, $scope.kataid).then((response) => console.log(response));
8080
}
8181

82-
// this function needs to call the kata by id when the user selects train on the home page -getKataById
83-
84-
85-
// submit final solution once they have passed the testSuite using setSoluton funciton on the service
86-
82+
$scope.submitAnswer = (solution, kataid, userid) => {
83+
mainService.submitAnswer(solution, kataid, userid);
84+
}
8785

8886
});

0 commit comments

Comments
 (0)