define(
    [
        'Amasty_CheckoutCore/js/model/resource-url-manager',
        'Magento_Checkout/js/model/quote',
        'mage/storage'
    ],
    function (
        resourceUrlManager,
        quote,
        storage
    ) {
        "use strict";

        return function (itemId, formData) {
            return storage.post(
                resourceUrlManager.getUrlForUpdateItem(quote),
                JSON.stringify({
                    itemId: itemId,
                    formData: formData
                }), false
            );
        };
    }
);
