diff --git a/src/node/db/API.js b/src/node/db/API.js index 661b7859507..4a1371ba5df 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -154,6 +154,13 @@ Example returns: */ exports.setText = function(padID, text, callback) { + //text is required + if(typeof text != "string") + { + callback(new customError("text is no string","apierror")); + return; + } + //get the pad getPadSafe(padID, true, function(err, pad) { @@ -298,7 +305,10 @@ exports.getLastEdited = function(padID, callback) getPadSafe(padID, true, function(err, pad) { if(ERR(err, callback)) return; - callback(null, {lastEdited: pad.getLastEdited()}); + pad.getLastEdit(function(err, value) { + if(ERR(err, callback)) return; + callback(null, {lastEdited: value}); + }); }); } diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index c7897e7724b..1f4a6f2cc81 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -3,6 +3,7 @@ var express = require('express'); var settings = require('../utils/Settings'); var fs = require('fs'); var path = require('path'); +var npm = require("npm/lib/npm.js"); var _ = require("underscore"); var server; diff --git a/src/static/tests.html b/src/static/tests.html index bd5bc578f40..cbcd90af4fd 100644 --- a/src/static/tests.html +++ b/src/static/tests.html @@ -3,7 +3,7 @@ API Test and Examples Page - +