VSearch.js 855 B

12345678910111213141516171819202122232425
  1. define([ "require", "utils/Globals", "models/BaseModel", "utils/UrlLinks" ], function(require, Globals, VBaseModel, UrlLinks) {
  2. "use strict";
  3. var VSearch = VBaseModel.extend({
  4. urlRoot: UrlLinks.searchApiUrl(),
  5. defaults: {},
  6. serverSchema: {},
  7. idAttribute: "id",
  8. initialize: function() {
  9. this.modelName = "VSearch";
  10. },
  11. toString: function() {
  12. return this.get("name");
  13. },
  14. getEntity: function(id, options) {
  15. var url = UrlLinks.entitiesApiUrl({
  16. guid: id
  17. });
  18. return options = _.extend({
  19. contentType: "application/json",
  20. dataType: "json"
  21. }, options), this.constructor.nonCrudOperation.call(this, url, "GET", options);
  22. }
  23. }, {});
  24. return VSearch;
  25. });