summaryrefslogtreecommitdiff
path: root/iridescence/src/components/admin
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-11-13 10:05:48 -0500
committerAdam T. Carpenter <atc@53hor.net>2020-11-13 10:05:48 -0500
commit23272d18ef2eccd1a451bbd2aefb1f067b30962b (patch)
tree24ecb5f7b5a99e17271145de796969ecb34f8bdd /iridescence/src/components/admin
parent9b77f9ec2c00b48c551f65b2e9d7a087004de4c0 (diff)
downloadtheglassyladies-23272d18ef2eccd1a451bbd2aefb1f067b30962b.tar.xz
theglassyladies-23272d18ef2eccd1a451bbd2aefb1f067b30962b.zip
basic sorting functional; swapped indexes for ids in edit list
Diffstat (limited to 'iridescence/src/components/admin')
-rw-r--r--iridescence/src/components/admin/ProductEditCard.vue4
-rw-r--r--iridescence/src/components/admin/ProductEditList.vue6
2 files changed, 5 insertions, 5 deletions
diff --git a/iridescence/src/components/admin/ProductEditCard.vue b/iridescence/src/components/admin/ProductEditCard.vue
index aced39c..2927b42 100644
--- a/iridescence/src/components/admin/ProductEditCard.vue
+++ b/iridescence/src/components/admin/ProductEditCard.vue
@@ -126,7 +126,7 @@ export default {
};
},
props: {
- index: {
+ oldid: {
type: Number,
required: true
}
@@ -148,7 +148,7 @@ export default {
},
computed: {
old: function() {
- return this.$store.getters.products[this.index] || {};
+ return this.$store.getters.products.find(p => p.id == this.oldid) || {};
},
id: function() {
return this.diff.id || this.old.id;
diff --git a/iridescence/src/components/admin/ProductEditList.vue b/iridescence/src/components/admin/ProductEditList.vue
index 0880d7c..91c0929 100644
--- a/iridescence/src/components/admin/ProductEditList.vue
+++ b/iridescence/src/components/admin/ProductEditList.vue
@@ -3,10 +3,10 @@
<div class="columns is-multiline is-variable is-desktop">
<div
class="column is-one-third-desktop"
- v-for="(product, index) in products"
- :key="index"
+ v-for="product in products"
+ :key="product.id"
>
- <ProductEditCard v-bind:index="index"></ProductEditCard>
+ <ProductEditCard v-bind:oldid="product.id"></ProductEditCard>
</div>
</div>
</div>