Permalink
Browse files

Merge pull request #4 from waquner/master

fields musste array sein
  • Loading branch information...
2 parents 00fba3f + cc0a705 commit d9f5c37e74791e9be0d0bb0b7fa897aeb8805d7b ΦΔ committed Sep 26, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 sfdc.js
View
@@ -250,12 +250,14 @@ function fetch(ctx, objectClass, id, fields, callback) {
callback = fields;
fields = undefined;
}
+
+ fields = ('string' === typeof fields) ? [fields]: fields;
fields = ('object' === typeof fields) ? fields : undefined;
fields = (fields && !util.isArray(fields)) ? Object.keys(fields) : fields;
fields = (fields && fields.length) ? { 'fields':fields.join(', ') } : undefined;
ctx.actions.push({
- 'command':makeURL(ctx, ['sobjects',objectClass,id,fields]),
+ 'command':makeURL(ctx, ['sobjects',objectClass,id], fields),
'method':'GET',
'callback':callback,
'domain':process.domain

0 comments on commit d9f5c37

Please sign in to comment.