Skip to content

Commit

Permalink
fixed error handling and method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jwulf committed Oct 16, 2012
1 parent 614886c commit cdecd02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "pressgang-rest",
"version": "0.0.3",
"version": "0.0.4",
"description": "A high level library for REST communication with a PressGang Component Content Management System (CCMS) Server",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 9 additions & 5 deletions pressgangccms.js
Expand Up @@ -60,11 +60,14 @@ PressGangCCMS.prototype.set = function (key, value) {

PressGangCCMS.prototype.isContentSpec = function(topic_id, cb)
{
this.getTopicData(topic_id, 'topic-tags', function(err, result){
var is_spec = false;
if (result && result.length > 0){
for (var i = 0; i < result.length; i ++){
if (result[i].item.id == constants.contentSpecTagID) is_spec = true;
this.getTopicData('topic-tags', topic_id, function(err, result){
if (!err)
{
var is_spec = false;
if (result && result.length > 0){
for (var i = 0; i < result.length; i ++){
if (result[i].item.id == constants.contentSpecTagID) is_spec = true;
}
}
}
cb(err, is_spec);
Expand Down Expand Up @@ -131,3 +134,4 @@ PressGangCCMS.prototype.getTopicData = function(data_request, topic_id, cb)
}
}


0 comments on commit cdecd02

Please sign in to comment.