[#1977] APIv2 WIP - start of a framework where operations are shared

between client & server. If the op is called on the client, it updates
the user & then POSTs to the server with op of the same name. If called
on server, it updates the user and user.save()s
This commit is contained in:
Tyler Renelle
2013-12-11 09:30:39 -07:00
parent 842f0de838
commit ee1cd3c05d
39 changed files with 313 additions and 569 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
// ------------
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var helpers = require('habitrpg-shared/script/helpers');
var shared = require('habitrpg-shared');
var _ = require('lodash');
// Task Schema
@@ -14,7 +14,7 @@ var _ = require('lodash');
var TaskSchema = {
//_id:{type: String,'default': helpers.uuid},
id: {type: String,'default': helpers.uuid},
id: {type: String,'default': shared.uuid},
text: String,
notes: {type: String, 'default': ''},
tags: {type: Schema.Types.Mixed, 'default': {}}, //{ "4ddf03d9-54bd-41a3-b011-ca1f1d2e9371" : true },