Skip to content

Commit

Permalink
Remove unnecessary updateCard method, use minimongo instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mquandalle committed Jan 3, 2015
1 parent 3316725 commit 5fb35d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
9 changes: 5 additions & 4 deletions client/views/cards/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ Template.cardDetailWindow.events({
'submit #WindowTitleEdit': function(event, t) {
var title = t.find('#title').value;
if ($.trim(title)) {
Meteor.call('updateCard', this.card._id, {
title: title
}, function(err) {
// close editing
Cards.update(this.card._id, {
$set: {
title: title
}
}, function (err, res) {
if (!err) $('.editing').removeClass('editing');
});
}
Expand Down
11 changes: 6 additions & 5 deletions client/views/cards/rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Template.cards.rendered = function() {
stop: function(event, ui) {
var data = new Utils.getCardData(ui.item);

// update card

This comment has been minimized.

Copy link
@yasaricli

yasaricli Jan 6, 2015

why ? Drag and Drop Between Lists Bug #61 and update card server side.

Meteor.call('updateCard', data.cardId, {
oldListId: data.oldListId,
listId: data.listId,
sort: data.sort
Cards.update(data.cardId, {
$set: {
oldListId: data.oldListId,
listId: data.listId,
sort: data.sort
}
});
}
}).disableSelection();
Expand Down
7 changes: 0 additions & 7 deletions server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,5 @@ Meteor.methods({
approved: false
}
});
},
updateCard: function(_id, $set) {
check(_id, String);
check($set, Object);
Cards.update(_id, {
$set: $set
});
}
});

0 comments on commit 5fb35d1

Please sign in to comment.