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) === '_';
|
return val.substr(0, 1) === '_';
|
||||||
},
|
},
|
||||||
|
|
||||||
collectionApiType: function (identifier) {
|
collectionApiType: function (identifier, refresh) {
|
||||||
if (this.CollectionTypes[identifier] === undefined) {
|
// set "refresh" to disable caching collection type
|
||||||
|
if (refresh || this.CollectionTypes[identifier] === undefined) {
|
||||||
this.CollectionTypes[identifier] = window.arangoDocumentStore
|
this.CollectionTypes[identifier] = window.arangoDocumentStore
|
||||||
.getCollectionInfo(identifier).type;
|
.getCollectionInfo(identifier).type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,7 +331,8 @@ var documentsView = Backbone.View.extend({
|
||||||
|
|
||||||
addDocument: function () {
|
addDocument: function () {
|
||||||
var collid = window.location.hash.split("/")[1];
|
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') {
|
if (doctype === 'edge') {
|
||||||
$('#edgeCreateModal').modal('show');
|
$('#edgeCreateModal').modal('show');
|
||||||
|
|
Loading…
Reference in New Issue