create_request.js 723 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { product_base } from "./product_base.js";
  2. import { login_manager } from "./login_manager.js";
  3. import { bool_response } from "./bool_response.js";
  4. import { request } from "./request.js";
  5. export class create_request extends request {
  6. #image;
  7. #product;
  8. constructor(product, image) {
  9. super();
  10. this.#image = image;
  11. this.#product = product;
  12. }
  13. get _response() {
  14. return bool_response;
  15. }
  16. get data() {
  17. return Object.assign(this.#product.dump, {
  18. "image": this.#image,
  19. "apikey": this._apikey
  20. });
  21. }
  22. get method() {
  23. return "POST";
  24. }
  25. get url() {
  26. return "/product/create";
  27. }
  28. }