import { product_base } from "./product_base.js";
import { login_manager } from "./login_manager.js";
import { bool_response } from "./bool_response.js";
import { request } from "./request.js";

export class edit_request extends request {
    #target;
    #updated;

    constructor(target, updated) {
        super();

        this.#target = target;
        this.#updated = updated;
    }

    get _response() {
        return bool_response;
    }

    get data() {
        return Object.assign(this.#updated.dump, {
            "apikey": this._apikey
        });
    }

    get method() {
        return "POST";
    }

    get url() {
        return "/product/update/barcode/" + this.#target.barcode;
    }
}
