completionId: cgen-54b3760891ee434bb4e86625692a3796
cgen-54b3760891ee434bb4e86625692a3796
This commit is contained in:
parent
6749b26c8d
commit
c7b3142e6e
1 changed files with 14 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue