discourse-subscriptions/assets/javascripts/discourse/models/admin-product.js.es6

22 lines
437 B
Plaintext
Raw Normal View History

2019-10-14 18:40:49 -04:00
import { ajax } from "discourse/lib/ajax";
const AdminProduct = Discourse.Model.extend({
destroy() {},
save() {
const data = {};
return ajax("/patrons/admin/products", { method: "post", data });
}
});
AdminProduct.reopenClass({
find() {
return ajax("/patrons/admin/products", { method: "get" }).then(result =>
result.map(product => AdminProduct.create(product))
);
}
});
export default AdminProduct;