Fix store references

This commit is contained in:
James Cole
2022-05-08 09:32:07 +02:00
31 changed files with 225 additions and 121 deletions

View File

@@ -133,7 +133,7 @@
<script>
import Post from "../../api/webhooks/post";
// import {mapGetters} from "vuex";
import {getCacheKey} from "../../store/fireflyiii/getters";
// import {getCacheKey} from "../../store/fireflyiii/getters";
export default {
name: 'Create',

View File

@@ -130,6 +130,7 @@
<script>
import Get from "../../api/webhooks/get";
import Put from "../../api/webhooks/put";
import {useFireflyIIIStore} from "../../stores/fireflyiii";
export default {
name: "Edit",
@@ -165,6 +166,7 @@ export default {
response: '',
delivery: '',
trigger: '',
store: null,
}
},
computed: {
@@ -174,6 +176,7 @@ export default {
},
created() {
this.id = parseInt(this.$route.params.id);
this.store = useFireflyIIIStore();
this.collectWebhook();
},
methods: {
@@ -233,7 +236,7 @@ export default {
this.errorMessage = '';
},
processSuccess: function (response) {
this.$store.dispatch('fireflyiii/refreshCacheKey');
this.store.refreshCacheKey();
if (!response) {
return;
}

View File

@@ -88,6 +88,7 @@
// import {mapGetters} from "vuex";
import Destroy from "../../api/generic/destroy";
import List from "../../api/webhooks/list";
import {useFireflyIIIStore} from "../../stores/fireflyiii";
export default {
name: 'Index',
@@ -116,6 +117,7 @@ export default {
{name: 'title', label: 'Title', field: 'title', align: 'left'},
{name: 'menu', label: ' ', field: 'menu', align: 'right'},
],
store: null,
}
},
computed: {
@@ -123,6 +125,7 @@ export default {
},
created() {
this.pagination.rowsPerPage = this.getListPageSize;
this.store = useFireflyIIIStore();
},
mounted() {
this.triggerUpdate();
@@ -140,7 +143,7 @@ export default {
},
destroyWebhook: function (id) {
(new Destroy('webhooks')).destroy(id).then(() => {
this.$store.dispatch('fireflyiii/refreshCacheKey');
this.store.refreshCacheKey();
this.triggerUpdate();
});
},