Fixed Product Creation Error
This commit is contained in:
@@ -205,12 +205,14 @@ const createItem = async () => {
|
||||
let ret = null
|
||||
|
||||
if(props.inModal) {
|
||||
ret = await dataStore.createNewItem(type,item.value,true)
|
||||
ret = await useEntities(type).create(item.value, true)
|
||||
|
||||
} else {
|
||||
ret = await useEntities(type).create(item.value)//dataStore.createNewItem(type,item.value)
|
||||
}
|
||||
|
||||
emit('returnData', ret)
|
||||
modal.close()
|
||||
}
|
||||
|
||||
const updateItem = async () => {
|
||||
|
||||
@@ -35,7 +35,7 @@ const item = ref({})
|
||||
const setupPage = async () => {
|
||||
if(props.mode === "show") {
|
||||
//Load Data for Show
|
||||
item.value = await useSupabaseSelectSingle(props.type, props.id, dataType.supabaseSelectWithInformation || "*")
|
||||
item.value = await useEntities(props.type).selectSingle(props.id, dataType.supabaseSelectWithInformation || "*")
|
||||
} else if(props.mode === "edit") {
|
||||
//Load Data for Edit
|
||||
const data = JSON.stringify((await supabase.from(props.type).select().eq("id", props.id).single()).data)
|
||||
@@ -48,7 +48,7 @@ const setupPage = async () => {
|
||||
|
||||
} else if(props.mode === "list") {
|
||||
//Load Data for List
|
||||
items.value = await useSupabaseSelect(props.type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
||||
items.value = await useEntities(props.type).select(dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
Reference in New Issue
Block a user