Skip to content

Commit

Permalink
Fix tax settings saving bug
Browse files Browse the repository at this point in the history
  • Loading branch information
impactmass committed Mar 6, 2017
1 parent c97de61 commit 6c389a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/modules/accounts/templates/tax-settings/taxSettings.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import _ from "lodash";
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { Accounts } from "/lib/collections";
import { Accounts as AccountsSchema } from "/lib/collections/schemas/accounts";
import { Reaction } from "/client/api";
import { TaxEntityCodes } from "/client/collections";

Template.taxSettingsPanel.helpers({
account() {
if (Reaction.Subscriptions.Account.ready()) {
return Accounts.findOne({
_id: this.member.userId
});
const sub = Meteor.subscribe("Accounts.single", this.member.userId);
if (sub.ready()) {
return Accounts.findOne({ _id: this.member.userId });
}
return null;
},
Expand Down
11 changes: 11 additions & 0 deletions server/publications/collections/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ Meteor.publish("Accounts", function (userId) {
});
});

/**
* Single account
* @params {String} userId - id of user to find
*/
Meteor.publish("Accounts.single", function (userId) {
check(userId, Match.OneOf(String, null));
return Collections.Accounts.find({
userId: userId
});
});

/**
* userProfile
* @deprecated since version 0.10.2
Expand Down

0 comments on commit 6c389a5

Please sign in to comment.