Changed Backend to Supabase

This commit is contained in:
2023-11-26 17:15:55 +01:00
parent 8b76434b41
commit cb3d48d42c
22 changed files with 1420 additions and 346 deletions

View File

@@ -40,7 +40,7 @@
<div class="listContainer">
<a v-for="item in products" @click="selectItem(item)">
<UCard class="listItem">
<UBadge>{{item.id}}</UBadge> {{item.attributes.name}} - {{item.attributes.manufacturer}}
<UBadge>{{item.id}}</UBadge> {{item.name}} - {{item.manufacturer}}
</UCard>
</a>
</div>
@@ -52,30 +52,30 @@
<div id="right">
<div v-if="false">
<img
v-if="selectedItem.attributes.image"
:src="'http://localhost:1337' + selectedItem.attributes.image.data.attributes.url"/>
{{selectedItem.attributes.image.data.attributes.url}}
v-if="selectedItem.image"
:src="'http://localhost:1337' + selectedItem.image.data.url"/>
{{selectedItem.image.data.url}}
</div>
<UCard v-if="selectedItem.attributes">
<UCard v-if="selectedItem.id">
<template #header>
<UBadge>{{selectedItem.id}}</UBadge> {{selectedItem.attributes.name}}
<UBadge>{{selectedItem.id}}</UBadge> {{selectedItem.name}}
</template>
<!-- <UBadge
<UBadge
v-for="tag in selectedItem.tags"
class="mr-2"
>
{{tag}}
</UBadge>-->
</UBadge>
<UDivider class="my-3"/>
<div v-if="selectedItem.attributes">
Hersteller: {{selectedItem.attributes.manufacturer}}<br>
Einkaufspreis: {{selectedItem.attributes.purchasePriceNet.toFixed(2)}} <br>
Aufschlag: {{selectedItem.attributes.profitPercentage}} %<br>
Verkaufspreis: {{selectedItem.attributes.retailPriceNet.toFixed(2)}} <br>
<div v-if="selectedItem">
Hersteller: {{selectedItem.manufacturer}}<br>
Einkaufspreis: {{selectedItem.purchasePriceNet}} <br>
Aufschlag: {{selectedItem.profitPercentage}} %<br>
Verkaufspreis: {{selectedItem.retailPriceNet}} <br>
</div>
<UDivider class="my-3"/>
<!--<UDivider class="my-3"/>
<p>Verlauf:</p>
<table>
@@ -97,7 +97,7 @@
</td>
</tr>
</table>
</table>-->
<!-- <div
@@ -122,8 +122,11 @@ definePageMeta({
middleware: "auth"
})
const {find,create} = useStrapi4()
const products = (await find('products',{populate: "*"})).data
const supabase = useSupabaseClient()
const products = (await supabase.from("products").select()).data
const showCreateProduct = ref(false)
const createProductData = ref({})