diff --git a/examples/parties/client/client.js b/examples/parties/client/client.js
index 0d769eda72..976eeadb44 100644
--- a/examples/parties/client/client.js
+++ b/examples/parties/client/client.js
@@ -209,6 +209,7 @@ Template.createDialog.events = {
'click .save': function (event, template) {
var title = template.find(".title").value;
var description = template.find(".description").value;
+ var public = !template.find(".private").checked;
if (title.length && description.length) {
var coords = Session.get("createCoords");
@@ -217,7 +218,10 @@ Template.createDialog.events = {
description: description,
x: coords.x,
y: coords.y,
- public: true // XXX
+ public: public
+ }, function(error, party) {
+ if (!error)
+ Session.set("selected", party);
});
Session.set("showCreateDialog", false);
} else {
diff --git a/examples/parties/model.js b/examples/parties/model.js
index 8201683855..de1de30fbd 100644
--- a/examples/parties/model.js
+++ b/examples/parties/model.js
@@ -57,7 +57,7 @@ Meteor.methods({
if (! this.userId)
throw new Meteor.Error(403, "You must be logged in");
- Parties.insert({
+ return Parties.insert({
owner: this.userId,
x: options.x,
y: options.y,
diff --git a/examples/parties/parties.html b/examples/parties/parties.html
index 4504d733ca..fdf16ac70c 100644
--- a/examples/parties/parties.html
+++ b/examples/parties/parties.html
@@ -35,6 +35,7 @@
Title:
Description
+ Private party?
diff --git a/examples/parties/server/server.js b/examples/parties/server/server.js
index 1696593e56..f63019f80d 100644
--- a/examples/parties/server/server.js
+++ b/examples/parties/server/server.js
@@ -7,5 +7,5 @@ Meteor.publish("directory", function () {
Meteor.publish("parties", function () {
return Parties.find(
- {$or: [{"public": true}, {canSee: this.userId}]});
+ {$or: [{"public": true}, {canSee: this.userId}, {owner: this.userId}]});
});