1234567891011121314151617181920212223242526 |
- /**
- * Client code for the comments template.
- *
- * - events
- */
- Template.comments.events({
- "submit .js-comment-submit": function (event) {
- const contents = event.target["comment-input"].value;
- const user = Meteor.user();
- const comment = {
- poster: {
- _id: user._id,
- name: user.username
- },
- contents: contents
- };
- const modifier = {
- $push: {
- comments: comment
- }
- };
- console.log(modifier);
- Websites.update({ _id: this._id }, modifier);
- return false;
- }
- });
|