Explorar o código

Update comments for other data

Lee Morgan %!s(int64=6) %!d(string=hai) anos
pai
achega
1881cb38a2
Modificáronse 2 ficheiros con 16 adicións e 9 borrados
  1. 16 7
      controllers/otherData.js
  2. 0 2
      views/dashboardPage/orders.js

+ 16 - 7
controllers/otherData.js

@@ -6,11 +6,14 @@ const Order = require("../models/order");
 const Transaction = require("../models/transaction");
 
 module.exports = {
-    //POST - logs the user in
-    //Inputs:
-    //  req.body.email
-    //  req.body.password
-    //Redirects to "/dashboard" on success
+    /*
+    POST - logs the user in
+    req.body = {
+        email: email of the user,
+        password: password of the user
+    }
+    Redirects to /dashboard
+    */
     login: function(req, res){
         Merchant.findOne({email: req.body.email.toLowerCase()})
             .then((merchant)=>{
@@ -36,8 +39,10 @@ module.exports = {
             });
     },
 
-    //GET - logs the user out
-    //Redirects to "/"
+    /*
+    GET - logs the user out
+    Redirects to /
+    */
     logout: function(req, res){
         req.session.user = undefined;
 
@@ -96,7 +101,11 @@ module.exports = {
             });
     },
 
+    /*
+    POST - Changes the users password
+    */
     resetPassword: function(req, res){
+        console.log(req.body);
         Merchant.findOne({password: req.body.hash})
             .then((merchant)=>{
                 if(merchant){

+ 0 - 2
views/dashboardPage/orders.js

@@ -23,9 +23,7 @@ window.ordersStrandObj = {
                             listDiv.removeChild(listDiv.firstChild);
                         }
 
-                        console.log(response);
                         for(let i = 0; i < response.length; i++){
-                            console.log(response[i])
                             let row = template.cloneNode(true);
                             let totalCost = 0;