我希望“商品”是唯一的,因此如果用户再次单击同一商品,它将更新并将 1 添加到我的“数量”并添加“价格”并插入新记录(如果不唯一)。我尝试使用 upsert/onConflict 但没有太多信息。
const incrementOrder = async ({item, quantity, price}) =>{
const {data, error} = await supabase
.from("ordereditems")
.insert([{item, quantity, price}])
}