Fix filters inherited from repository with wrong facets.

This commit is contained in:
mateuswetah 2020-11-13 12:29:12 -03:00
parent 0c6cc40d31
commit e765c0fb14
3 changed files with 8 additions and 8 deletions

View File

@ -154,13 +154,13 @@
let route = ''; let route = '';
if (this.isRepositoryLevel || this.filter.collection_id == 'default') if (this.isRepositoryLevel)
route = `/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items); route = `/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
else { else {
if ((this.collectionId == 'default' || this.filter.inherited) && this.currentCollectionId) if (this.filter.collection_id == 'default' && this.currentCollectionId)
route = `/collection/${this.currentCollectionId}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items); route = `/collection/${this.currentCollectionId}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
else else
route = `/collection/${this.collectionId}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items); route = `/collection/${this.filter.collection_id}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
} }
this.options = []; this.options = [];

View File

@ -114,13 +114,13 @@
let endpoint = ''; let endpoint = '';
if (this.isRepositoryLevel || this.filter.collection_id == 'default') if (this.isRepositoryLevel)
endpoint += '/facets/' + this.metadatumId; endpoint += '/facets/' + this.metadatumId;
else { else {
if (this.collectionId == 'default' && this.currentCollectionId) if (this.filter.collection_id == 'default' && this.currentCollectionId)
endpoint += '/collection/' + this.currentCollectionId +'/facets/' + this.metadatumId; endpoint += '/collection/' + this.currentCollectionId +'/facets/' + this.metadatumId;
else else
endpoint += '/collection/' + this.collectionId +'/facets/' + this.metadatumId; endpoint += '/collection/' + this.filter.collection_id + '/facets/' + this.metadatumId;
} }
endpoint += '?order=asc&' + qs.stringify(query_items); endpoint += '?order=asc&' + qs.stringify(query_items);

View File

@ -77,7 +77,7 @@ export const dynamicFilterTypeMixin = {
let url = ''; let url = '';
if (isRepositoryLevel || this.filter.collection_id == 'default') if (isRepositoryLevel)
url = `/facets/${metadatumId}?getSelected=${getSelected}&`; url = `/facets/${metadatumId}?getSelected=${getSelected}&`;
else { else {
if (this.filter.collection_id == 'default' && this.currentCollectionId) if (this.filter.collection_id == 'default' && this.currentCollectionId)
@ -161,7 +161,7 @@ export const dynamicFilterTypeMixin = {
let url = ''; let url = '';
if (isRepositoryLevel || this.filter.collection_id == 'default') if (isRepositoryLevel)
url = `/facets/${this.filter.metadatum.metadatum_id}?getSelected=${getSelected}&`; url = `/facets/${this.filter.metadatum.metadatum_id}?getSelected=${getSelected}&`;
else { else {
if (this.filter.collection_id == 'default' && this.currentCollectionId) if (this.filter.collection_id == 'default' && this.currentCollectionId)