Removed Bugs

This commit is contained in:
2023-11-28 08:13:21 +01:00
parent 7cc942b42f
commit ff966418b2
9 changed files with 106 additions and 13 deletions

View File

@@ -26,8 +26,11 @@
<UFormGroup
label="Einheit:"
>
<UInput
v-model="createProductData.unit"
<USelectMenu
v-model="createProductData.unit"
:options="units"
value-attribute="id"
option-attribute="name"
/>
</UFormGroup>
@@ -124,9 +127,8 @@ definePageMeta({
const supabase = useSupabaseClient()
const products = (await supabase.from("products").select()).data
const units = (await supabase.from("units").select()).data
const showCreateProduct = ref(false)
const createProductData = ref({})
@@ -150,7 +152,15 @@ const selectItem = (item) => {
}
const createProduct = async () => {
await create('products', createProductData.value)
//await create('products', createProductData.value)
const {data,error} = await supabase
.from("products")
.insert([createProductData.value])
.select()
console.log(error)
showCreateProduct.value = false
createProductData.value = {}