Commit e384f6cef420aaac1c380ef65409a3822237962e

Authored by Andrew Buss
1 parent 665f8186cd

add trailing slashes on login API calls

Showing 7 changed files with 31 additions and 31 deletions Side-by-side Diff

scripts/DeckController.js View file @ e384f6c
... ... @@ -16,8 +16,8 @@
16 16  
17 17  
18 18 // reorganize cards in array based on time
19   - $scope.filter = function (card) {
20   -
  19 + $scope.filter = function(card) {
  20 +
21 21 // get index of card
22 22 var index = $scope.cards.indexOf(card);
23 23  
... ... @@ -38,7 +38,7 @@
38 38 };
39 39  
40 40  
41   - $scope.editCard = function (card) {
  41 + $scope.editCard = function(card) {
42 42  
43 43 var index = $scope.cards.indexOf(card);
44 44  
45 45  
46 46  
... ... @@ -47,13 +47,13 @@
47 47 opacity: .5, // Opacity of modal background
48 48 in_duration: 300, // Transition in duration
49 49 out_duration: 200, // Transition out duration
50   - ready: function () {
51   -
  50 + ready: function() {
52 51  
  52 +
53 53 $scope.editableContent = $scope.cards[index].content;
54 54 }, // Callback for Modal open
55   - complete: function () {
56   -
  55 + complete: function() {
  56 +
57 57 $scope.cards[index].content = $scope.editableContent;
58 58  
59 59 } // Callback for Modal close
60 60  
... ... @@ -61,8 +61,8 @@
61 61 );
62 62  
63 63  
64   -
65 64  
  65 +
66 66 //alert($scope.cards[index].content);
67 67  
68 68 // post flashcard edits
... ... @@ -75,7 +75,7 @@
75 75 });
76 76  
77 77 */
78   - }
  78 + };
79 79  
80 80  
81 81  
scripts/FeedController.js View file @ e384f6c
... ... @@ -10,7 +10,7 @@
10 10 $scope.cards[1] = { 'id': 2, 'title': 'title2', 'content': 'xyz' };
11 11 $scope.cards[2] = { 'id': 2, 'title': 'title3', 'content': 'qwe' };
12 12  
13   - $http.get("/api/sections/{pk}/flashcards").
  13 + $http.get('/api/sections/{pk}/flashcards').
14 14 success(function(data) {
15 15 for (var i = 0; i < data.length; i++) {
16 16 cards.push({ 'title': data[i].title, 'content': data[i].content });
... ... @@ -50,8 +50,8 @@
50 50  
51 51 $scope.flashcard = 'hi i am a flashcard. I need to be really long and awesome I ain\'t know how long I am right now. Is it good enough now?????????? Howz about now???';
52 52 $scope.text = '';
53   -
54   - $(document).ready(function(){
  53 +
  54 + $(document).ready(function() {
55 55 // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
56 56 $('.modal-trigger').leanModal({
57 57 dismissible: true, // Modal can be dismissed by clicking outside of the modal
scripts/LoginController.js View file @ e384f6c
... ... @@ -6,7 +6,7 @@
6 6 $scope.uniqueError = false;
7 7 $scope.loginError = false;
8 8 $scope.login = function(email, password) {
9   - $http.post('/api/login', JSON.stringify({
  9 + $http.post('/api/login/', JSON.stringify({
10 10 'email': email,
11 11 'password': password
12 12 })).
... ... @@ -23,7 +23,7 @@
23 23 });
24 24 };
25 25 $scope.signUp = function(email, password) {
26   - $http.post('/api/register', JSON.stringify({
  26 + $http.post('/api/register/', JSON.stringify({
27 27 'email': email,
28 28 'password': password
29 29 })).
... ... @@ -48,9 +48,9 @@
48 48 $scope.triggerPasswordReset = function() {
49 49 $state.go('requestpasswordreset');
50 50 };
51   - $(document).ready(function(){
52   - $('ul.tabs').tabs();
53   - });
  51 + $(document).ready(function() {
  52 + $('ul.tabs').tabs();
  53 + });
54 54 }
55 55 ]);
scripts/RequestResetController.js View file @ e384f6c
... ... @@ -12,14 +12,14 @@
12 12 .success(function(data) {
13 13 $scope.success = true;
14 14 //$state.go('requestresetsuccess');
15   - console.log("SUCCESS");
  15 + console.log('SUCCESS');
16 16 console.log(data);
17 17 })
18 18 .error(function(data, status, header, config) {
19 19 if (data.email) {
20 20 $scope.error = true;
21 21 }
22   - console.log("ERROR");
  22 + console.log('ERROR');
23 23 console.log(data);
24 24 });
25 25 };
scripts/ResetPasswordController.js View file @ e384f6c
... ... @@ -4,8 +4,8 @@
4 4 function($scope, $state, $http, $timeout) {
5 5 'use strict';
6 6 var url = document.location.href.split('/');
7   - var token = url[url.length-1];
8   - var uid = url[url.length-2];
  7 + var token = url[url.length - 1];
  8 + var uid = url[url.length - 2];
9 9 $scope.error = false;
10 10 $scope.success = false;
11 11 $scope.mismatch = false;
12 12  
13 13  
14 14  
... ... @@ -13,16 +13,16 @@
13 13 /*if(token == 'resetpassword') {
14 14 $state.go('login');
15 15 }*/
16   - console.log("RESETTING");
  16 + console.log('RESETTING');
17 17 $scope.confirmResetPass = function() {
18   - if($scope.newPassword.length < 8) {
  18 + if ($scope.newPassword.length < 8) {
19 19 $scope.unacceptable = true;
20 20 return;
21 21 }
22   - if($scope.newPassword != $scope.confirmPassword) {
  22 + if ($scope.newPassword != $scope.confirmPassword) {
23 23 $scope.mismatch = true;
24 24 $scope.confirmPassword.$setPristine();
25   - console.log("mismatch");
  25 + console.log('mismatch');
26 26 return;
27 27 }
28 28 $http.post('/api/reset_password', JSON.stringify({
scripts/StudyController.js View file @ e384f6c
... ... @@ -2,7 +2,7 @@
2 2  
3 3 controller('StudyController', ['$scope', '$state',
4 4 function($scope, $state) {
5   - console.log("hello from review controller");
  5 + console.log('hello from review controller');
6 6 $scope.htmlContent = 'hello there from js review ctrl';
7 7 }
8 8 ]);
scripts/VerifyEmailController.js View file @ e384f6c
... ... @@ -4,16 +4,16 @@
4 4 function($scope, $state, $http, $timeout) {
5 5 'use strict';
6 6 var url = document.location.href.split('/');
7   - var key = url[url.length-1];
  7 + var key = url[url.length - 1];
8 8 $scope.success = false;
9 9 $scope.error = false;
10   -
  10 +
11 11 $http.patch('/api/me', JSON.stringify({
12 12 'confirmation_key': key
13 13 }))
14 14 .success(function(data) {
15 15 $scope.success = true;
16   - console.log("SUCCESS");
  16 + console.log('SUCCESS');
17 17 console.log(data);
18 18 $timeout(function($state) {
19 19 $state.go('feed');
... ... @@ -21,7 +21,7 @@
21 21 })
22 22 .error(function(data, status, header, config) {
23 23 $scope.error = true;
24   - console.log("ERROR");
  24 + console.log('ERROR');
25 25 console.log(data);
26 26 });
27 27 }