Ludvig
04/27/2022, 2:57 PMcustomer
table via the supabase-js client.
javascript
const { data: dataCustomerUpdate, error: errorCustomerUpdate } =
await supabase.from("customer").update(
{
first_name: checkoutForm.billingFirstName,
last_name: checkoutForm.billingLastName,
email_address: checkoutForm.billingEmail,
mobile_phone_number: checkoutForm.billingMobilePhoneNumber,
},
)
.eq("id", customerIdSelectedFromIncomingOrderTable) // Here is where I need help.
I need to find what customer
row to update. This is the problem.
I have another table called incoming_order
which contains a stripe_payment_id
and the foreign key customer_id
which I'm looking to select.
I have the stripe_payment_id
string which should be used to find (filter for) the correct row in incoming_order
, and from that row I need to get the customer_id
used instead of the customerIdSelectedFromIncomingOrderTable
which I wrote above.
I'm looking to do it all in this one query if that is possible.Needle
04/27/2022, 2:57 PM/title
command!
We have solved your problem?
Click the button below to archive it.silentworks
04/27/2022, 3:22 PM.rpc
method to do both in one query.Needle
04/27/2022, 3:22 PMsilentworks
04/27/2022, 3:22 PMLudvig
04/27/2022, 3:26 PMLudvig
04/27/2022, 3:26 PM