소스 검색

Remove Activity model.
Remove any instances of the activity model and anywhere that it is used.
I really see no use for the model and it just makes more code and more things to store to the database.

Lee Morgan 5 년 전
부모
커밋
6998f3f68a
2개의 변경된 파일0개의 추가작업 그리고 27개의 파일을 삭제
  1. 0 11
      controllers/renderer.js
  2. 0 16
      models/activity.js

+ 0 - 11
controllers/renderer.js

@@ -1,7 +1,6 @@
 const ObjectId = require("mongoose").Types.ObjectId;
 
 const Transaction = require("../models/transaction.js");
-const Activity = require("../models/activity.js");
 
 const helper = require("./helper.js");
 
@@ -30,16 +29,6 @@ module.exports = {
     Renders inventoryPage
     */
     displayDashboard: function(req, res){
-        new Activity({
-            ipAddr: req.headers['x-forwarded-for'] || req.connection.remoteAddress,
-            merchant: res.locals.merchant._id,
-            route: "dashboard",
-            date: new Date()
-        })
-            .save()
-            .catch(()=>{});
-
-
         let merchant2 = {};
         res.locals.merchant
             .populate("inventory.ingredient")

+ 0 - 16
models/activity.js

@@ -1,16 +0,0 @@
-const mongoose = require("mongoose");
-
-const ActivitySchema = new mongoose.Schema({
-    ipAddr: String,
-    merchant: {
-        type: mongoose.Schema.Types.ObjectId,
-        ref: "Merchant"
-    },
-    route: String,
-    date: {
-        type: Date,
-        required: true
-    }
-});
-
-module.exports = mongoose.model("Activity", ActivitySchema);