|  | @@ -61,7 +61,12 @@ if (Meteor.isClient) {
 | 
											
												
													
														|  |          alert("You need to login first.");
 |  |          alert("You need to login first.");
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |        else {
 |  |        else {
 | 
											
												
													
														|  | -        Meteor.call("addDoc");
 |  | 
 | 
											
												
													
														|  | 
 |  | +        Meteor.call("addDoc", function (err, res) {
 | 
											
												
													
														|  | 
 |  | +          if (!err) {
 | 
											
												
													
														|  | 
 |  | +            console.log("addDoc res", res);
 | 
											
												
													
														|  | 
 |  | +            Session.set("docid", res);
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +        });
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
										
											
												
													
														|  | @@ -90,7 +95,8 @@ Meteor.methods({
 | 
											
												
													
														|  |          createdOn: new Date(),
 |  |          createdOn: new Date(),
 | 
											
												
													
														|  |          title: "my new doc"
 |  |          title: "my new doc"
 | 
											
												
													
														|  |        };
 |  |        };
 | 
											
												
													
														|  | -      Documents.insert(doc);
 |  | 
 | 
											
												
													
														|  | 
 |  | +      const docid = Documents.insert(doc);
 | 
											
												
													
														|  | 
 |  | +      return docid;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |  
 |  |  
 |