Removed Bugs
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user