Closed IonicaBizau closed 11 years ago
Marking as invalid.
The problem was that I was trying to get basic templates that probably crud stop access to them.
The solution found is:
var query = {};
var options = {};
var fields = {
_id: 1
};
var crudObj = {
t: '000000000000000000000000',
q: query,
o: options,
f: fields
};
// get all template ids
self.emit("find", crudObj, function (err, data) {
// handle error
if (err) {
console.error(err);
return;
}
// an array with template ids
var _ids = [];
for (var i = 0; i < data.length; ++i) {
if (data[i]._id === '000000000000000000000004') { continue; }
_ids.push(data[i]._id);
}
// get templates
self.emit('getTemplates', _ids, function(err, data) {
// do something with data
});
});
I get
"Invalid templates"
error when making the following crud request: