remove category action stubbed out

This commit is contained in:
Annika
2022-07-14 10:52:45 -06:00
parent 01389630f8
commit 8afe3a046f
2 changed files with 17 additions and 9 deletions
+6 -6
View File
@@ -1920,9 +1920,9 @@
"dev": true "dev": true
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.14.4", "version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@@ -5091,9 +5091,9 @@
"dev": true "dev": true
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.14.4", "version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
}, },
"fraction.js": { "fraction.js": {
"version": "4.2.0", "version": "4.2.0",
+11 -3
View File
@@ -1,6 +1,9 @@
<template> <template>
<div class="component p-2"> <div class="component p-2">
<h3 :class="`text-3xl ${totalSpent() > category.budgeted ? 'text-red-400' : 'text-green-300'}`">{{category.name}}</h3> <div class="flex justify-between">
<h3 :class="`text-3xl ${totalSpent() > category.budgeted ? 'text-red-400' : 'text-green-300'}`">{{category.name}}</h3>
<i v-show="category._id" class="text-3xl mdi mdi-delete hover:bg-red-400 hover:text-stone-900 cursor-pointer" @click="removeCategory()"></i>
</div>
<h4 class="text-2xl">Spent: ${{totalSpent()}}</h4> <h4 class="text-2xl">Spent: ${{totalSpent()}}</h4>
<h4 class="text-2xl">Budgeted: ${{category.budgeted}}</h4> <h4 class="text-2xl">Budgeted: ${{category.budgeted}}</h4>
</div> </div>
@@ -21,11 +24,16 @@ export default {
return 0 return 0
} }
for (let t = 0; t < this.category.transactions.length; t++) { for (let t = 0; t < this.category.transactions.length; t++) {
total += this.category.transactions[t].amount // TODO count inflow and outflow seperately total += this.category.transactions[t].amount // TODO count inflow and outflow seperately... ornot?
} }
return total return total
}, },
category: computed(() => AppState.activeCategory) category: computed(() => AppState.activeCategory),
async removeCategory() {
if (!AppState.activeCategory._id) {
console.log('trying to delete overview...')
}
}
} }
} }
} }