Guest User

Untitled

a guest
Jul 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. this.get('#/reply', function (context) {
  2. var fields = this.params, doc = {};
  3. doc.content = fields.post;
  4. doc.datetime = new Date.now();
  5. doc.thread_id = fields.thread_id;
  6. doc.type = 'post';
  7. doc.user_id = 'chapel';
  8. db.saveDoc(doc, {
  9. success: function() {
  10. this.redirect('#/thread/'+fields.thread_id);
  11. },
  12. error: function() {
  13. alert('Error saving document.');
  14. this.redirect('#/thread/'+fields.thread_id);
  15. }
  16. })
  17. });
Add Comment
Please, Sign In to add comment