summaryrefslogtreecommitdiff
path: root/server/lib/views/subscription.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/views/subscription.js')
-rw-r--r--server/lib/views/subscription.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/server/lib/views/subscription.js b/server/lib/views/subscription.js
new file mode 100644
index 0000000..e29e40d
--- /dev/null
+++ b/server/lib/views/subscription.js
@@ -0,0 +1,41 @@
+/* jshint node: true */
+
+var User = require('../schemas/User'),
+ Subscription = require('../schemas/Subscription'),
+ config = require('../../../config'),
+ middleware = require('../middleware'),
+ util = require('../util'),
+ _ = require('lodash'),
+ moment = require('moment');
+
+var subscription = module.exports = {
+
+ fields: {
+ user: "_id username displayName photo created_at updated_at last_seen created_ip last_ip",
+ },
+
+ defaults: {
+ user: {
+ _id: "", username: "", displayName: "",
+ created_at: "", updated_at: "", created_ip: "", last_ip: "",
+ },
+ },
+
+ middleware: {
+ },
+
+ helpers: {
+ project: function(project){
+ project = project.toObject()
+ project.date = moment( project.updated_at || project.created_at ).format("M/DD/YYYY hh:mm a")
+ project.user = {}
+ return project
+ },
+ },
+
+ // need a route for the webhook,
+ // then calls to get appropriate info from the recurly api
+ webhook: function(req, res){
+ res.status(200).end()
+ },
+}