completionId: cgen-54b3760891ee434bb4e86625692a3796

cgen-54b3760891ee434bb4e86625692a3796
This commit is contained in:
Builder.io 2025-11-12 02:40:46 +00:00
parent 6749b26c8d
commit c7b3142e6e

View file

@ -105,6 +105,20 @@ export default async function handler(req: any, res: any) {
.select();
if (error) throw error;
// If ecosystem license type, create ecosystem license record
if (license_type === "ecosystem" && data && data[0]) {
const trackId = data[0].id;
await supabase.from("ethos_ecosystem_licenses").insert([
{
track_id: trackId,
artist_id: userId,
accepted_at: new Date().toISOString(),
},
]);
}
res.status(201).json(data[0]);
}
} catch (err: any) {