methods.js 263 B

123456789101112
  1. Meteor.methods({
  2. "chats.insert": function (chat) {
  3. check(chat, {
  4. user1Id: String,
  5. user2Id: String
  6. });
  7. chat.messages = [];
  8. const chatId = Chats.insert(chat);
  9. Meteor._debug("chats.insert", chat, chatId);
  10. return chatId;
  11. }
  12. });