* fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint line around directives issue * fix: eslint prefer template issue * fix: eslint semi rule * fix: eslint newline per chain rule * fix: eslint space infix ops rule * fix: eslint space-in-parens issue * fix: eslint space before function paren issue * fix: eslint space before blocks issue * fix: eslint arrow body style issue * fix: eslint dot-location issue * fix: eslint quotes issue * fix: eslint quote props issue * fix: eslint operator assignment issue * fix: eslint new line after import issue * fix: indent issues * fix: operator assignment issue
25 lines
583 B
JavaScript
25 lines
583 B
JavaScript
/**
|
|
* Utilities for modules/xblocks.
|
|
*
|
|
* Returns:
|
|
*
|
|
* urlRoot: the root for creating/updating an xblock.
|
|
* getUpdateUrl: a utility method that returns the xblock update URL, appending
|
|
* the location if passed in.
|
|
*/
|
|
define(['underscore'], function(_) {
|
|
var urlRoot = '/xblock';
|
|
|
|
var getUpdateUrl = function(locator) {
|
|
if (_.isUndefined(locator)) {
|
|
return `${urlRoot}/`;
|
|
} else {
|
|
return `${urlRoot}/${locator}`;
|
|
}
|
|
};
|
|
return {
|
|
urlRoot: urlRoot,
|
|
getUpdateUrl: getUpdateUrl
|
|
};
|
|
});
|