HEAVYPOLY
07/22/2022, 5:31 AM{
"record": {
"email": "asd@gmail.com",
"id": "16c34376-54ff-49dc-a374-f32b063ef5da"
}
}Needle
07/22/2022, 5:31 AMgaryaustin
07/22/2022, 12:48 PMgaryaustin
07/22/2022, 12:48 PMHEAVYPOLY
07/22/2022, 5:06 PMHEAVYPOLY
07/22/2022, 5:17 PMconst handler = async(req, res) => {
const stripe = initStripe(process.env.STRIPE_SECRET);
const customer = await stripe.customers.create({
name: req.body.record.id,
email: req.body.record.email
});
// res.send({ message: `stripe customer created: ${JSON.stringify(req.body.record)}` });
res.send({ message: `stripe customer created: ${customer.id} ${req.body.record.email} ${req.body.record.id}` });
Now this second part (await supabase) is not working, does anything look wrong here?
await supabase
.from('user_data')
.update({ stripe_customer: customer.id})
.eq('id', req.body.record.id);
};
export default handler;HEAVYPOLY
07/22/2022, 5:23 PM