From c7b3142e6ecc847de2204ca1393e5286596e8169 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 12 Nov 2025 02:40:46 +0000 Subject: [PATCH] completionId: cgen-54b3760891ee434bb4e86625692a3796 cgen-54b3760891ee434bb4e86625692a3796 --- api/ethos/tracks.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/ethos/tracks.ts b/api/ethos/tracks.ts index 1b3f7946..7f202e86 100644 --- a/api/ethos/tracks.ts +++ b/api/ethos/tracks.ts @@ -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) {