Change save_item and create_item to RESTful URL.
Part of STUD-847.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
define(["backbone"], function(Backbone) {
|
||||
define(["backbone", "js/utils/module"], function(Backbone, ModuleUtils) {
|
||||
var ModuleInfo = Backbone.Model.extend({
|
||||
urlRoot: "/xblock",
|
||||
urlRoot: ModuleUtils.urlRoot,
|
||||
|
||||
defaults: {
|
||||
"id": null,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
define(["backbone", "gettext", "js/views/feedback_notification"], function(Backbone, gettext, NotificationView) {
|
||||
define(["backbone", "gettext", "js/views/feedback_notification", "js/utils/module"],
|
||||
function(Backbone, gettext, NotificationView, ModuleUtils) {
|
||||
|
||||
var Section = Backbone.Model.extend({
|
||||
defaults: {
|
||||
"name": ""
|
||||
@@ -8,10 +10,9 @@ define(["backbone", "gettext", "js/views/feedback_notification"], function(Backb
|
||||
return gettext("You must specify a name");
|
||||
}
|
||||
},
|
||||
url: "/save_item",
|
||||
urlRoot: ModuleUtils.urlRoot,
|
||||
toJSON: function() {
|
||||
return {
|
||||
id: this.get("id"),
|
||||
metadata: {
|
||||
display_name: this.get("name")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user