Skip to content

Commit 35cd425

Browse files
author
Olivier Refalo
committed
fixed based on latest webstorm
1 parent 15cb0d5 commit 35cd425

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

parties/client/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// <reference path="../../lib.d.ts" />
22
// <reference path="../../meteor.d.ts" />
33
// <reference path="../../d3.d.ts" />
4-
// <reference path="../model.ts" />
4+
// <reference path="../model.d.ts" />
55

66
// All Tomorrow's Parties -- client
77

@@ -234,7 +234,7 @@ Template['page'].showCreateDialog = function () {
234234
};
235235

236236
Template['createDialog'].events({
237-
'click .save': function (event, template) {
237+
'click .save': function (event:Meteor.EventHandler, template:Meteor.TemplateInstance) {
238238
var title = template.find(".title").value;
239239
var description = template.find(".description").value;
240240
var public = !(<any>template.find(".private")).checked;

parties/model.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// <reference path="../meteor.d.ts" />
22
/// <reference path="../underscore.d.ts" />
3-
interface PartyDAO {
3+
4+
interface PartiesDAO {
45
_id?: string;
56
owner?: string;
67
x?: number;
@@ -12,4 +13,4 @@ interface PartyDAO {
1213
rsvps?: Array;
1314
}
1415

15-
declare var Parties:Meteor.Collection<PartyDAO>;
16+
declare var Parties:Meteor.Collection<PartiesDAO>;

parties/model.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var attending = function(party) {
2222
return (_.groupBy(party.rsvps, 'rsvp')['yes'] || []).length;
2323
};
2424

25-
Parties = new Meteor.Collection<PartyDAO>("parties");
25+
Parties = new Meteor.Collection<PartiesDAO>("parties");
2626

2727
Parties.allow({
2828
insert: function(userId, party) {
@@ -57,6 +57,7 @@ var Coordinate = Match.Where(function(x) {
5757
return x >= 0 && x <= 1;
5858
});
5959

60+
6061
Meteor.methods({
6162
// options should include: title, description, x, y, public
6263
createParty: function(options) {
@@ -93,7 +94,7 @@ Meteor.methods({
9394

9495
check(partyId, String);
9596
check(userId, String);
96-
var party = Parties.findOne(partyId);
97+
var party:PartiesDAO = Parties.findOne(partyId);
9798
if (!party || party.owner !== self.userId)
9899
throw new Meteor.Error(404, "No such party");
99100
if (party.public)
@@ -126,7 +127,7 @@ Meteor.methods({
126127
throw new Meteor.Error(403, "You must be logged in to RSVP");
127128
if (!_.contains(['yes', 'no', 'maybe'], rsvp))
128129
throw new Meteor.Error(400, "Invalid RSVP");
129-
var party = Parties.findOne(partyId);
130+
var party:PartiesDAO = Parties.findOne(partyId);
130131
if (!party)
131132
throw new Meteor.Error(404, "No such party");
132133
if (!party.public && party.owner !== this.userId && !_.contains(party.invited, this.userId))

parties/server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// <reference path="../../lib.d.ts" />
22
// <reference path="../../meteor.d.ts" />
3-
// <reference path="../model.ts" />
3+
// <reference path="../model.d.ts" />
44
// All Tomorrow's Parties -- server
55

66
Meteor.publish("directory", function () {

0 commit comments

Comments
 (0)