Untitled
Never
var core = require('../core'); /** * Abstraction layer for commentable core API * * @param object api */ function Comment(api) { this.api = api.scope(this); } Comment.DEFAULT_OBJECT_TYPE = 'fsobject'; Comment.DEFAULT_REVISION_ID = 0; /** * Implements comment API */ Comment.prototype = new core.api.Implementation({ /** * Get all comments. API returns { list: [comments...] } * * @param object record {id: ..., type: ...} * @param int revisionId starts from 0 * @return */ getAll: function (data) { this.api.get('/comment/find', { objId: data.record.id, objType: data.record.type || Comment.DEFAULT_OBJECT_TYPE, objRevision: data.revisionId || Comment.DEFAULT_REVISION_ID }) .then(function (data) { console.log(data) this.done(data); }); return this; }, /** * Create comment * * @param string text * @param object record {id: ..., type: ...} * @param int revisionId * @param string replyTo optional, id of parent comment * @return */ create: function (data) { var post = { text: data.text, discussedObj: { '$id': data.record.id, '$ref': data.record.type || Comment.DEFAULT_OBJECT_TYPE }, objRevision: data.revisionId || Comment.DEFAULT_REVISION_ID }; if (data.replyTo) { post.answerTo = data.replyTo; } this.api.post('/comment', post).then(function (data) { console.log(data); this.done(data); }); return this; }, /** * Remove comment * * @param object record {id: ..., type: ...} * @param int revisionId starts from 0 * @param string parentId optional * @return */ remove: function (data) { var post = { objId: data.record.id, objType: data.record.type || Comment.DEFAULT_OBJECT_TYPE, objRevision: data.revisionId || Comment.DEFAULT_REVISION_ID }; if (data.parentId) { post.parentCommentId = data.parentId; } this.api.del('comment/find', post).then(function (data) { console.log(data); }); return this; } }); core.api().register(Comment);
Raw Text
-
Sister's best friend got my eggs for breakfast - the perfect friend
8 min ago
-
No Deposit Bonus
9 min ago
-
Adult Telegram Channels
9 min ago
-
vbrteyu7uhge4uvcfw3erujdrr34
42 min ago
-
PAWG Rharri Rhound Wants More Than a Weight Work Out She Wants a Big Cock Work Out
43 min ago
-
Sultry Smoking Blonde MILF In Fishnets Bra and Panties - Nikki Ashton
1 hour ago
-
TUSHY A DP With My Husband and Ex-Boyfriend
1 hour ago
-
ctfyfyuytiuyiyu
1 hour ago
-
Untitled
2 hours ago
-
Threesome sex, blowjob, mouthfuck, doggy, pussy licking, huge cumshot, cum kissing (Short)
2 hours ago