Perform request to absolute endpoint. #734.

This commit is contained in:
mateuswetah 2022-10-04 11:36:23 -03:00
parent 927873a78e
commit 0e07408852
1 changed files with 9 additions and 11 deletions

View File

@ -105,7 +105,7 @@
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { tainacan as axios } from '../../js/axios'; import axios from 'axios';
export default { export default {
name: 'CollectionCreationModal', name: 'CollectionCreationModal',
@ -116,11 +116,6 @@ export default {
collectionPresets: [] collectionPresets: []
} }
}, },
watch: {
hasPresetsHook() {
this.selectedEstrategy = this.hasPresetsHook ? undefined : 'mappers';
}
},
computed: { computed: {
metadatumMappers() { metadatumMappers() {
return this.getMetadatumMappers(); return this.getMetadatumMappers();
@ -133,11 +128,16 @@ export default {
}, },
getPresetsHook() { getPresetsHook() {
if (wp !== undefined && wp.hooks !== undefined) if (wp !== undefined && wp.hooks !== undefined)
this.collectionPresets = wp.hooks.applyFilters(`tainacan_collections_presets`, this.collectionPresets); return wp.hooks.applyFilters(`tainacan_collections_presets`, this.collectionPresets);
return this.collectionPresets; return this.collectionPresets;
}, },
}, },
watch: {
hasPresetsHook() {
this.selectedEstrategy = this.hasPresetsHook ? undefined : 'mappers';
}
},
mounted() { mounted() {
this.isLoadingMetadatumTypes = true; this.isLoadingMetadatumTypes = true;
@ -161,10 +161,8 @@ export default {
]), ]),
onNewCollectionPreset(collectionPreset) { onNewCollectionPreset(collectionPreset) {
axios.post(collectionPreset.endpoint) axios.post(collectionPreset.endpoint)
.then((response) => { .then(() => {
console.log(response); this.$router.push(this.$routerHelper.getCollectionsPath());
this.$router.push($routerHelper.getCollectionsPath());
this.$parent.close(); this.$parent.close();
}) })
.catch((error) =>{ .catch((error) =>{