From 0ef577c6deae3ec79bf15cd2ecdcb185b892c70f Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Thu, 15 Jan 2026 08:56:52 -0500 Subject: [PATCH 1/2] feat: update createArtist to call recoup-api endpoint Update lib/createArtist.tsx to call the migrated /api/artist/create endpoint on recoup-api instead of the local endpoint. Related to MYC-3924: Migrate /api/artist/create REST endpoint Co-Authored-By: Claude Opus 4.5 --- lib/createArtist.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/createArtist.tsx b/lib/createArtist.tsx index f6b76e065..dcfa17f05 100644 --- a/lib/createArtist.tsx +++ b/lib/createArtist.tsx @@ -1,13 +1,14 @@ +import { NEW_API_BASE_URL } from "@/lib/consts"; + const createArtist = async (name: string, account_id: string) => { try { const response = await fetch( - `/api/artist/create?name=${encodeURIComponent(name)}&account_id=${account_id}`, + `${NEW_API_BASE_URL}/api/artist/create?name=${encodeURIComponent(name)}&account_id=${account_id}`, ); const data = await response.json(); return data.artist; } catch (error) { - console.error(error); return null; } }; From 0626b92fdde4bd51396bee796161278dff98c57d Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Thu, 15 Jan 2026 09:04:48 -0500 Subject: [PATCH 2/2] feat: update createArtist to use POST /api/artist endpoint Updated to call the new REST-compliant POST /api/artist endpoint with JSON body instead of GET /api/artist/create with query params. Co-Authored-By: Claude Opus 4.5 --- lib/createArtist.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/createArtist.tsx b/lib/createArtist.tsx index dcfa17f05..36e1565da 100644 --- a/lib/createArtist.tsx +++ b/lib/createArtist.tsx @@ -2,9 +2,13 @@ import { NEW_API_BASE_URL } from "@/lib/consts"; const createArtist = async (name: string, account_id: string) => { try { - const response = await fetch( - `${NEW_API_BASE_URL}/api/artist/create?name=${encodeURIComponent(name)}&account_id=${account_id}`, - ); + const response = await fetch(`${NEW_API_BASE_URL}/api/artist`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ name, account_id }), + }); const data = await response.json(); return data.artist;