Skip to content

Commit 2a6a67f

Browse files
committed
changed backend stuff
1 parent 366a4fa commit 2a6a67f

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/components/mainService.js

Lines changed: 3 additions & 5 deletions
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,
@@ -96,11 +98,7 @@ angular.module('app').service('mainService', function($http, $q, $sce) {
9698
this.getKataSolutions = (kataid) => {
9799
return $http({
98100
method: 'GET',
99-
<<<<<<< HEAD
100-
url: `/api/kata-random/` + kyu
101-
=======
102101
url: `/api/solutions/` + kataid
103-
>>>>>>> master
104102
});
105103
};
106104

src/components/training/trainingCtrl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +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-
83-
84-
82+
$scope.submitAnswer = (solution, kataid, userid) => {
83+
mainService.submitAnswer(solution, kataid, userid);
84+
}
8585

8686
});

0 commit comments

Comments
 (0)