Skip to content

Instantly share code, notes, and snippets.

@ermst4r
Created November 30, 2017 07:43
Show Gist options
  • Save ermst4r/9068e0c8af1cc3308a8abba1092aa144 to your computer and use it in GitHub Desktop.
Save ermst4r/9068e0c8af1cc3308a8abba1092aa144 to your computer and use it in GitHub Desktop.
js example
/**
* Previous user was a bot
*/
if (bid.fk_user_id === 0 && bid.fk_profile_bot_id > 0) {
var bid_type = method.populateBidType(bid);
var new_bid = bid.bid + 1;
Profilebot.generateRandomAutobotId(bid.fk_profile_bot_id).then(function (bot) {
return bot;
}).then(function (bot) {
var insert_data = ProfileBid.prepareInsertData(bid.fk_user_id, bot.bot_id, item.id, new_bid, bid_type);
return insert_data;
}).then(function (insert_data) {
return insert_data;
}).then(function (insert_data) {
ActiveAuctionProfile.increaseProfileTime(item.id,10).then(function (value) {
});
}). catch(function (reason) {
reject(reason);
});
/**
* prev user was a real user
*/
} else if(bid.fk_user_id > 0 && bid.fk_profile_bot_id === 0 ) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment