change engine mount point and base path in jsapp

This commit is contained in:
Rimian Perkins
2019-12-03 10:29:44 +11:00
parent 382fd4ac41
commit 08cbff0c1c
23 changed files with 29 additions and 28 deletions
@@ -20,7 +20,7 @@ const AdminPlan = Plan.extend({
},
destroy() {
return ajax(`/patrons/admin/plans/${this.id}`, { method: "delete" });
return ajax(`/s/admin/plans/${this.id}`, { method: "delete" });
},
save() {
@@ -35,7 +35,7 @@ const AdminPlan = Plan.extend({
active: this.active
};
return ajax("/patrons/admin/plans", { method: "post", data });
return ajax("/s/admin/plans", { method: "post", data });
},
update() {
@@ -46,19 +46,19 @@ const AdminPlan = Plan.extend({
active: this.active
};
return ajax(`/patrons/admin/plans/${this.id}`, { method: "patch", data });
return ajax(`/s/admin/plans/${this.id}`, { method: "patch", data });
}
});
AdminPlan.reopenClass({
findAll(data) {
return ajax("/patrons/admin/plans", { method: "get", data }).then(result =>
return ajax("/s/admin/plans", { method: "get", data }).then(result =>
result.map(plan => AdminPlan.create(plan))
);
},
find(id) {
return ajax(`/patrons/admin/plans/${id}`, { method: "get" }).then(plan =>
return ajax(`/s/admin/plans/${id}`, { method: "get" }).then(plan =>
AdminPlan.create(plan)
);
}
@@ -5,7 +5,7 @@ const AdminProduct = Discourse.Model.extend({
metadata: {},
destroy() {
return ajax(`/patrons/admin/products/${this.id}`, { method: "delete" });
return ajax(`/s/admin/products/${this.id}`, { method: "delete" });
},
save() {
@@ -16,7 +16,7 @@ const AdminProduct = Discourse.Model.extend({
active: this.active
};
return ajax("/patrons/admin/products", {
return ajax("/s/admin/products", {
method: "post",
data
}).then(product => AdminProduct.create(product));
@@ -30,7 +30,7 @@ const AdminProduct = Discourse.Model.extend({
active: this.active
};
return ajax(`/patrons/admin/products/${this.id}`, {
return ajax(`/s/admin/products/${this.id}`, {
method: "patch",
data
});
@@ -39,13 +39,13 @@ const AdminProduct = Discourse.Model.extend({
AdminProduct.reopenClass({
findAll() {
return ajax("/patrons/admin/products", { method: "get" }).then(result =>
return ajax("/s/admin/products", { method: "get" }).then(result =>
result.map(product => AdminProduct.create(product))
);
},
find(id) {
return ajax(`/patrons/admin/products/${id}`, {
return ajax(`/s/admin/products/${id}`, {
method: "get"
}).then(product => AdminProduct.create(product));
}
@@ -20,7 +20,7 @@ const AdminSubscription = Discourse.Model.extend({
},
destroy() {
return ajax(`/patrons/admin/subscriptions/${this.id}`, {
return ajax(`/s/admin/subscriptions/${this.id}`, {
method: "delete"
}).then(result => AdminSubscription.create(result));
}
@@ -28,7 +28,7 @@ const AdminSubscription = Discourse.Model.extend({
AdminSubscription.reopenClass({
find() {
return ajax("/patrons/admin/subscriptions", {
return ajax("/s/admin/subscriptions", {
method: "get"
}).then(result =>
result.data.map(subscription => AdminSubscription.create(subscription))
@@ -4,7 +4,7 @@ const Invoice = Discourse.Model.extend({});
Invoice.reopenClass({
findAll() {
return ajax("/patrons/invoices", { method: "get" }).then(result =>
return ajax("/s/invoices", { method: "get" }).then(result =>
result.map(invoice => Invoice.create(invoice))
);
}
@@ -21,7 +21,7 @@ const Plan = Discourse.Model.extend({
Plan.reopenClass({
findAll(data) {
return ajax("/patrons/plans", { method: "get", data }).then(result =>
return ajax("/s/plans", { method: "get", data }).then(result =>
result.map(plan => Plan.create(plan))
);
}
@@ -4,13 +4,13 @@ const Product = Discourse.Model.extend({});
Product.reopenClass({
findAll() {
return ajax("/patrons/products", { method: "get" }).then(result =>
return ajax("/s/products", { method: "get" }).then(result =>
result.map(product => Product.create(product))
);
},
find(id) {
return ajax(`/patrons/products/${id}`, { method: "get" }).then(product =>
return ajax(`/s/products/${id}`, { method: "get" }).then(product =>
Product.create(product)
);
}
@@ -13,13 +13,13 @@ const Subscription = Discourse.Model.extend({
plan: this.plan
};
return ajax("/patrons/subscriptions", { method: "post", data });
return ajax("/s/subscriptions", { method: "post", data });
}
});
Subscription.reopenClass({
findAll() {
return ajax("/patrons/subscriptions", { method: "get" }).then(result =>
return ajax("/s/subscriptions", { method: "get" }).then(result =>
result.map(subscription => Subscription.create(subscription))
);
}
@@ -9,7 +9,7 @@ const UserSubscription = Discourse.Model.extend({
},
destroy() {
return ajax(`/patrons/user/subscriptions/${this.id}`, {
return ajax(`/s/user/subscriptions/${this.id}`, {
method: "delete"
}).then(result => UserSubscription.create(result));
}
@@ -17,7 +17,7 @@ const UserSubscription = Discourse.Model.extend({
UserSubscription.reopenClass({
findAll() {
return ajax("/patrons/user/subscriptions", { method: "get" }).then(result =>
return ajax("/s/user/subscriptions", { method: "get" }).then(result =>
result.map(subscription => {
subscription.plan = Plan.create(subscription.plan);
return UserSubscription.create(subscription);