-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat): add setAccountProfileCurrency mutation #4094
(feat): add setAccountProfileCurrency mutation #4094
Conversation
server/methods/accounts/accounts.js
Outdated
* @summary Sets users profile currency | ||
*/ | ||
export function setProfileCurrency(currencyName) { | ||
export function setProfileCurrency(accountId, currencyName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see accountId
added as second arg, which is then backwards compatible and you don't have to modify the places that call this.
This also needs to check to make sure the current user has permission to update accountId
|
||
// retrive all currencies from the Shops collection and xform them | ||
function getXformedCurrenciesByShop() { | ||
const shopCurrencies = Reaction.getShopCurrencies(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to merge my changes that give access to Mongo outside of Meteor first, and then change this to use the collections from context
. We need to avoid importing Reaction
@willopez Do you mind reviewing this one? Ignore the snyk failures because they're fixed in my other PR |
@aldeed I'll take look. |
…fileCurrencyMutation
NOTE: There is a known issue with an account's rate that will be addressed in a future PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Resolves #3922
Impact: minor
Type: feature
Issue
Add a
setAccountProfileCurrency
mutation to allow GraphQL to update and return currency data for an accountSolution
setAccountProfileCurrency
accounts/setProfileCurrency
meteor method to take in a userId, and to return an accountaccounts/setProfileCurrency
to add userIdBreaking changes
None. If a
userId
is not provided, the code will default to the current user, which is what happens at this time.Testing
accountId
being the base64 encoding of "reaction/account:{accountId}"