Removes uncessary calls to metadata store, which was causing errors on Metadata Page. This solves reordering issues on Ref. #124

This commit is contained in:
Mateus Machado Luna 2018-09-06 15:10:01 -03:00
parent dc5898e257
commit ec8b1056c3
3 changed files with 4 additions and 17 deletions

View File

@ -247,6 +247,7 @@
isRepositoryLevel: this.isRepositoryLevel,
isContextEdit: false,
includeDisabled: false,
isAdvancedSearch: true
}).then((metadata) => {
this.metadata = metadata;
this.metadataIsLoading = false;

View File

@ -90,7 +90,6 @@
<script>
import AdvancedSearch from '../advanced-search/advanced-search.vue';
import ProcessesPopup from '../other/processes-popup.vue';
import { mapActions } from 'vuex';
export default {
name: 'TainacanHeader',
@ -100,7 +99,6 @@
wordpressAdmin: window.location.origin + window.location.pathname.replace('admin.php', ''),
searchQuery: '',
futureSearchQuery: '',
metadata: Array,
showProcesses: false,
hasNewProcess: false
}
@ -110,9 +108,6 @@
ProcessesPopup
},
methods: {
...mapActions('metadata', [
'fetchMetadata'
]),
// toItemsPage() {
// if(this.$route.path == '/items') {
// this.$root.$emit('openAdvancedSearch', true);
@ -142,16 +137,6 @@
this.$root.$on('closeAdvancedSearchShortcut', () => {
this.$refs.advancedSearchShortcut.toggle();
});
this.fetchMetadata({
collectionId: false,
isRepositoryLevel: true,
isContextEdit: false,
includeDisabled: false,
})
.then((metadata) => {
this.metadata = metadata;
});
},
}
</script>

View File

@ -1,6 +1,6 @@
import axios from '../../../axios/axios';
export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isContextEdit, includeDisabled}) => {
export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isContextEdit, includeDisabled, isAdvancedSearch}) => {
return new Promise((resolve, reject) => {
let endpoint = '';
@ -20,7 +20,8 @@ export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isCont
axios.tainacan.get(endpoint)
.then((res) => {
let metadata = res.data;
commit('setMetadata', metadata);
if (!isAdvancedSearch)
commit('setMetadata', metadata);
resolve(metadata);
})
.catch((error) => {