User Configuration Library

This library is an adapter for the UserConfigurationService of the shop's backend codebase. It will perform AJAX requests for getting/setting user config data that is a robust way to store information about a specific user.

var options= {
    data: {
        userId: 1,  // Current user ID
        configurationKey: 'recent_search_area', // Configuration key
        configurationValue: '', // Configuration value (only for posting)
    },

    onSuccess: function (data) {}, // Callback function, that will be executed on successful request,
                                   // contains the response as argument.

    onError: function (data) {},   // Callback function, that will be executed on failed request.
}

jse.libs.user_configuration_service.set(options); // Set values

jse.libs.user_configuration_service.get(options); // Get values
Source:

Methods

(static) get(options)

Returns the user configuration value.

Parameters:
Name Type Description
options object
Properties
Name Type Description
onSuccess function

callback on success

onError function

callback on success

data object

request parameter

Source:

(static) set(options)

Sets the user configuration value.

Parameters:
Name Type Description
options object
Properties
Name Type Description
onSuccess function

callback on success

onError function

callback on success

data object

request parameter

Source: