Skip to content

Commit

Permalink
Add trailing slash to model URLs in the correct way (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Oct 8, 2024
1 parent e8ba65e commit 63bf97e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frontend/vre/utils/api.model.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import Backbone from 'backbone';
import { modelSlashUrl } from '@uu-cdh/backbone-util';
import { objectAsUrlParams } from './generic-functions';

/**
* Generic subclass that appends a slash to the model URL.
* This is required for interop with Django REST Framework.
*/
export var APIModel = Backbone.Model.extend({
url: function() {
return Backbone.Model.prototype.url.call(this) + '/';
},
url: modelSlashUrl(),
});

/**
Expand All @@ -27,4 +26,4 @@ export var APICollection = Backbone.Collection.extend({
}).value();
return this.fetch(fetchOptions);
},
});
});

0 comments on commit 63bf97e

Please sign in to comment.