mirror of https://gitee.com/bigwinds/arangodb
disable caching of collection type when creating documents
This commit is contained in:
parent
1afe978304
commit
ba25030fd7
|
@ -122,8 +122,9 @@ window.arangoHelper = {
|
|||
return val.substr(0, 1) === '_';
|
||||
},
|
||||
|
||||
collectionApiType: function (identifier) {
|
||||
if (this.CollectionTypes[identifier] === undefined) {
|
||||
collectionApiType: function (identifier, refresh) {
|
||||
// set "refresh" to disable caching collection type
|
||||
if (refresh || this.CollectionTypes[identifier] === undefined) {
|
||||
this.CollectionTypes[identifier] = window.arangoDocumentStore
|
||||
.getCollectionInfo(identifier).type;
|
||||
}
|
||||
|
|
|
@ -331,7 +331,8 @@ var documentsView = Backbone.View.extend({
|
|||
|
||||
addDocument: function () {
|
||||
var collid = window.location.hash.split("/")[1];
|
||||
var doctype = arangoHelper.collectionApiType(collid);
|
||||
// second parameter is "true" to disable caching of collection type
|
||||
var doctype = arangoHelper.collectionApiType(collid, true);
|
||||
|
||||
if (doctype === 'edge') {
|
||||
$('#edgeCreateModal').modal('show');
|
||||
|
|
Loading…
Reference in New Issue