From 10ff0deb01ab8609fdeefce302f5ee1a929d9c35 Mon Sep 17 00:00:00 2001 From: Colin Loretz Date: Thu, 12 Feb 2015 13:36:37 -0800 Subject: [PATCH] added updateMetricV2 --- numerous.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/numerous.js b/numerous.js index 5a881f0..d89f28b 100644 --- a/numerous.js +++ b/numerous.js @@ -130,6 +130,13 @@ Numerous.prototype.updateMetric = function(metric, callback) { self.makeRequest("PUT", self.url + '/metrics/' + metricId, metric, callback); } +Numerous.prototype.updateMetricV2 = function(metric, callback) { + var self = this; + var metricData = JSON.parse(metric); + var metricId = metricData.id + self.makeRequest("PUT", "https://api.numerousapp.com/v2/metrics/" + metricId, metric, callback); +} + Numerous.prototype.addMetricPhotoByUrl = function(metricId, photoURL, callback) { var self = this; var formData = { image : request(photoURL) };