Fixes View Collection button not always getting proper url.

This commit is contained in:
Mateus Machado Luna 2018-08-02 11:15:12 -03:00
parent 06df10b8c1
commit fb63dc9c27
2 changed files with 92 additions and 92 deletions

View File

@ -141,7 +141,7 @@ export default {
}, },
methods: { methods: {
...mapActions('collection', [ ...mapActions('collection', [
'fetchCollectionName' 'fetchCollectionNameAndURL'
]), ]),
...mapGetters('collection', [ ...mapGetters('collection', [
'getCollectionName', 'getCollectionName',
@ -172,8 +172,8 @@ export default {
switch(this.arrayRealPath[i-1]) { switch(this.arrayRealPath[i-1]) {
case 'collections': case 'collections':
this.fetchCollectionName(this.arrayRealPath[i]) this.fetchCollectionNameAndURL(this.arrayRealPath[i])
.then(collectionName => this.arrayViewPath.splice(i, 1, collectionName)) .then(collection => this.arrayViewPath.splice(i, 1, collection.name))
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
break; break;

View File

@ -46,7 +46,7 @@ export default {
}, },
methods: { methods: {
...mapActions('collection', [ ...mapActions('collection', [
'fetchCollectionName' 'fetchCollectionNameAndURL'
]), ]),
...mapGetters('collection', [ ...mapGetters('collection', [
'getCollectionName' 'getCollectionName'
@ -79,8 +79,8 @@ export default {
switch(this.arrayRealPath[i-1]) { switch(this.arrayRealPath[i-1]) {
case 'collections': case 'collections':
this.fetchCollectionName(this.arrayRealPath[i]) this.fetchCollectionNameAndURL(this.arrayRealPath[i])
.then(collectionName => { this.arrayViewPath.splice(i, 1, collectionName); this.entityName = collectionName; }) .then(collection => { this.arrayViewPath.splice(i, 1, collection.name); this.entityName = collection.name; })
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
break; break;
case 'items': case 'items':