<commit_before>define(["sprd/manager/IBasketManager", "flow"], function (IBasketManager, flow) {

    return IBasketManager.inherit('sprd.manager.ExternalBasketManager', {

        defaults: {
            externalBasket: null,
            basketItem: null
        },

        addElementToBasket: function (element, quantity, callback) {
            var externalBasket = this.$.externalBasket;

            this.extendElementWithLinks(element);

            externalBasket.addBasketItem(element, quantity, callback);
        },

        updateBasketItem: function (basketItem, element, quantity, cb) {
            var externalBasket = this.$.externalBasket;

            if (externalBasket && externalBasket.updateBasketItem) {
                externalBasket.updateBasketItem(basketItem, element, quantity, cb);
            }
        },

        saveBasket: function(cb) {
            cb && cb();
        },

        _initBasket: function (callback) {

            var basketImplementation = this.$stage.$parameter.basketImplementation;
            this.set("externalBasket", basketImplementation);

            flow()
                .seq(function() {
                    if (!basketImplementation) {
                        throw new Error("External basket implementation not found");
                    }
                })
                .exec(callback);
        }
    });


});<commit_msg>DEV-71696 - changed updateBasketItem for ExternalBasketManager<commit_after>define(["sprd/manager/IBasketManager", "flow"], function (IBasketManager, flow) {

    return IBasketManager.inherit('sprd.manager.ExternalBasketManager', {

        defaults: {
            externalBasket: null,
            basketItem: null
        },

        addElementToBasket: function (element, quantity, callback) {
            var externalBasket = this.$.externalBasket;

            this.extendElementWithLinks(element);

            externalBasket.addBasketItem(element, quantity, callback);
        },

        updateBasketItem: function (basketItem, element, quantity, cb) {
            basketItem.set({
                element: element,
                quantity: quantity
            });

            var externalBasket = this.$.externalBasket;
            basketItem.save(null, function (err) {
                if (!err) {
                    if (externalBasket && externalBasket.onBasketItemUpdated) {
                        externalBasket.onBasketItemUpdated(basketItem);
                    }
                }
                cb(err);
            });

        },

        saveBasket: function(cb) {
            cb && cb();
        },

        _initBasket: function (callback) {

            var basketImplementation = this.$stage.$parameter.basketImplementation;
            this.set("externalBasket", basketImplementation);

            flow()
                .seq(function() {
                    if (!basketImplementation) {
                        throw new Error("External basket implementation not found");
                    }
                })
                .exec(callback);
        }
    });


});
{'fraction_non_alphanumeric': 0.10035495321071314, 'fraction_numerical': 0.0016134236850596966, 'mean_word_length': 1.7288732394366197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2633194', 'n_tokens_mistral': 787, 'n_tokens_neox': 738, 'n_words': 140}