mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-03-06 01:29:31 +00:00
pretty js
This commit is contained in:
parent
78cbfc2652
commit
482ce178d5
@ -34,7 +34,9 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
|
||||
subscription.save().then(() => {
|
||||
bootbox.alert(I18n.t("discourse_patrons.transactions.payment.success"));
|
||||
bootbox.alert(
|
||||
I18n.t("discourse_patrons.transactions.payment.success")
|
||||
);
|
||||
this.transitionToRoute(
|
||||
"user.subscriptions",
|
||||
Discourse.User.current().username.toLowerCase()
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
// TODO: typo in this helper name: currency not curency.
|
||||
export default Ember.Helper.helper(function(params) {
|
||||
let currencySign;
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
export default Ember.Helper.helper(function(params) {
|
||||
let currencySign;
|
||||
|
||||
@ -13,5 +12,5 @@ export default Ember.Helper.helper(function(params) {
|
||||
currencySign = "$";
|
||||
}
|
||||
|
||||
return currencySign + params.map(p => p.toUpperCase()).join(' ');
|
||||
return currencySign + params.map(p => p.toUpperCase()).join(" ");
|
||||
});
|
||||
|
@ -10,8 +10,8 @@ Product.reopenClass({
|
||||
},
|
||||
|
||||
find(id) {
|
||||
return ajax(`/patrons/products/${id}`, { method: "get" }).then(
|
||||
product => Product.create(product)
|
||||
return ajax(`/patrons/products/${id}`, { method: "get" }).then(product =>
|
||||
Product.create(product)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -9,9 +9,9 @@ const UserSubscription = Discourse.Model.extend({
|
||||
},
|
||||
|
||||
destroy() {
|
||||
return ajax(`/patrons/user/subscriptions/${this.id}`, { method: "delete" }).then(
|
||||
result => UserSubscription.create(result)
|
||||
);
|
||||
return ajax(`/patrons/user/subscriptions/${this.id}`, {
|
||||
method: "delete"
|
||||
}).then(result => UserSubscription.create(result));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -4,13 +4,13 @@ import Subscription from "discourse/plugins/discourse-patrons/discourse/models/s
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
model(params) {
|
||||
const product_id = params["subscription-id"];
|
||||
const product = Product.find(product_id);
|
||||
const subscription = Subscription.create();
|
||||
const plans = Plan.findAll({ product_id: product_id }).then(results =>
|
||||
results.map(p => ({ id: p.id, name: p.subscriptionRate }))
|
||||
);
|
||||
const product_id = params["subscription-id"];
|
||||
const product = Product.find(product_id);
|
||||
const subscription = Subscription.create();
|
||||
const plans = Plan.findAll({ product_id: product_id }).then(results =>
|
||||
results.map(p => ({ id: p.id, name: p.subscriptionRate }))
|
||||
);
|
||||
|
||||
return Ember.RSVP.hash({ plans, product, subscription });
|
||||
},
|
||||
return Ember.RSVP.hash({ plans, product, subscription });
|
||||
}
|
||||
});
|
||||
|
@ -3,5 +3,5 @@ import Product from "discourse/plugins/discourse-patrons/discourse/models/produc
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
return Product.findAll();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user