Is it possibile create a topic in the future?
-
@baris I suppose that I'm wroing something because the topic is not created in the future. In my plugin.json I use this hook:
{ "hook": "action:topic.save", "method": "modificaPost" }
In my library.js I do this:
converter.modificaPost = function(data, callback) { console.log("DATA " + JSON.stringify(data)); //I Take the timestamp from database and you can suppose that it is correct because I check ten times. async.waterfall([ function(next) { //take the timestamp relative to user db.getObject(hash + ":uid:" + data.uid, next); }, function(timestamp, next) { var timestamp_nuovo = timestamp.timestamp; data.timestamp = timestamp.timestamp; Topics.post(data, next); } ], function(err) { if (err) { //return callback(err); } console.log("DATA NUOVA " + JSON.stringify(data)); return callback(null, data); }); };
Anyone can help me?
Copyright © 2024 NodeBB | Contributors