mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 09:11:20 +00:00
Clean up destroy routine
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
row-key="id"
|
||||
@request="onRequest"
|
||||
v-model:pagination="pagination"
|
||||
:loading="loading"
|
||||
class="q-ma-md"
|
||||
@@ -75,7 +74,7 @@
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import List from "../../api/accounts/list";
|
||||
import Destroy from "../../api/accounts/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
@@ -144,10 +143,11 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyAccount: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
(new Destroy('accounts')).destroy(id).then(() => {
|
||||
this.rows= [];
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey').then(() => {
|
||||
this.triggerUpdate();
|
||||
});
|
||||
});
|
||||
},
|
||||
updateBreadcrumbs: function () {
|
||||
@@ -169,14 +169,15 @@ export default {
|
||||
return string.replace(NON_ALPHANUM, '').toUpperCase().replace(EVERY_FOUR_CHARS, "$1 ");
|
||||
},
|
||||
triggerUpdate: function () {
|
||||
if (this.loading) {
|
||||
this.rows= [];
|
||||
if (true === this.loading) {
|
||||
return;
|
||||
}
|
||||
if (null === this.range.start || null === this.range.end) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
const list = new List();
|
||||
const list = new List;
|
||||
this.rows = [];
|
||||
list.list(this.type, this.page, this.getCacheKey).then(
|
||||
(response) => {
|
||||
@@ -198,8 +199,10 @@ export default {
|
||||
}
|
||||
this.loading = false;
|
||||
}
|
||||
)
|
||||
;
|
||||
).catch((err) => {
|
||||
console.error('Error loading list');
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
const parser = new Parser;
|
||||
this.rows = [];
|
||||
|
||||
get.transactions(this.id, this.page, this.getCacheKey).then(
|
||||
get.transactions(this.id, this.page).then(
|
||||
(response) => {
|
||||
let resp = parser.parseResponse(response);
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/budgets/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/budgets/list";
|
||||
|
||||
export default {
|
||||
@@ -135,8 +135,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyBudget: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('budgets')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/categories/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/categories/list";
|
||||
|
||||
export default {
|
||||
@@ -135,8 +135,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyCategory: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('categories')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/currencies/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/currencies/list";
|
||||
|
||||
export default {
|
||||
@@ -137,8 +137,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyCurrency: function (code) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(code).then(() => {
|
||||
(new Destroy('currencies')).destroy(code).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/groups/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/groups/list";
|
||||
|
||||
export default {
|
||||
@@ -119,9 +119,8 @@ export default {
|
||||
// TODO needs error catch.
|
||||
});
|
||||
},
|
||||
destroyGroup: function (code) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(code).then(() => {
|
||||
destroyGroup: function (identifier) {
|
||||
(new Destroy('object_groups')).destroy(identifier).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/piggy-banks/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/piggy-banks/list";
|
||||
|
||||
export default {
|
||||
@@ -131,8 +131,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyPiggyBank: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('piggy_banks')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import Destroy from "../../api/recurring/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/recurring/list";
|
||||
|
||||
export default {
|
||||
@@ -132,8 +132,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyRecurring: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('recurrences')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -80,8 +80,7 @@
|
||||
import {mapGetters} from "vuex";
|
||||
import List from "../../api/rule-groups/list";
|
||||
import Get from "../../api/rule-groups/get";
|
||||
import Destroy from "../../api/rule-groups/destroy";
|
||||
import DestroyRule from "../../api/rules/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
@@ -142,15 +141,13 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyRuleGroup: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('rule_groups')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
},
|
||||
destroyRule: function (id) {
|
||||
let destr = new DestroyRule;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('rules')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<script>
|
||||
import {mapGetters, useStore} from "vuex";
|
||||
import List from "../../api/subscriptions/list";
|
||||
import Destroy from "../../api/subscriptions/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
@@ -127,8 +127,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroySubscription: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('bills')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import Destroy from "../../api/webhooks/destroy";
|
||||
import Destroy from "../../api/generic/destroy";
|
||||
import List from "../../api/webhooks/list";
|
||||
|
||||
export default {
|
||||
@@ -119,8 +119,7 @@ export default {
|
||||
});
|
||||
},
|
||||
destroyWebhook: function (id) {
|
||||
let destr = new Destroy;
|
||||
destr.destroy(id).then(() => {
|
||||
(new Destroy('webhooks')).destroy(id).then(() => {
|
||||
this.$store.dispatch('fireflyiii/refreshCacheKey');
|
||||
this.triggerUpdate();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user