Update ArtistSettings to use API_BASE
cgen-29d7e24f58644d62b1b8b667258430cb
This commit is contained in:
parent
7c85b114b6
commit
207f0bec2e
1 changed files with 9 additions and 6 deletions
|
|
@ -23,6 +23,9 @@ import { useAethexToast } from "@/hooks/use-aethex-toast";
|
||||||
import { Upload, Music, Settings, CheckCircle, Clock } from "lucide-react";
|
import { Upload, Music, Settings, CheckCircle, Clock } from "lucide-react";
|
||||||
import EcosystemLicenseModal from "@/components/ethos/EcosystemLicenseModal";
|
import EcosystemLicenseModal from "@/components/ethos/EcosystemLicenseModal";
|
||||||
|
|
||||||
|
// API Base URL for fetch requests
|
||||||
|
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||||
|
|
||||||
const SKILLS = [
|
const SKILLS = [
|
||||||
"Synthwave",
|
"Synthwave",
|
||||||
"Orchestral",
|
"Orchestral",
|
||||||
|
|
@ -95,7 +98,7 @@ export default function ArtistSettings() {
|
||||||
|
|
||||||
const fetchProfile = async () => {
|
const fetchProfile = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`/api/ethos/artists?id=${user.id}`, {
|
const res = await fetch(`${API_BASE}/api/ethos/artists?id=${user.id}`, {
|
||||||
headers: { "x-user-id": user.id },
|
headers: { "x-user-id": user.id },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -115,7 +118,7 @@ export default function ArtistSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch verification status
|
// Fetch verification status
|
||||||
const verRes = await fetch(`/api/ethos/verification?status=pending`, {
|
const verRes = await fetch(`${API_BASE}/api/ethos/verification?status=pending`, {
|
||||||
headers: { "x-user-id": user.id },
|
headers: { "x-user-id": user.id },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -145,7 +148,7 @@ export default function ArtistSettings() {
|
||||||
|
|
||||||
setIsSubmittingVerification(true);
|
setIsSubmittingVerification(true);
|
||||||
try {
|
try {
|
||||||
const response = await fetch("/api/ethos/verification", {
|
const response = await fetch(`${API_BASE}/api/ethos/verification`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
@ -200,7 +203,7 @@ export default function ArtistSettings() {
|
||||||
|
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`/api/ethos/artists`, {
|
const res = await fetch(`${API_BASE}/api/ethos/artists`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
"x-user-id": user.id,
|
"x-user-id": user.id,
|
||||||
|
|
@ -244,7 +247,7 @@ export default function ArtistSettings() {
|
||||||
setIsAcceptingLicense(true);
|
setIsAcceptingLicense(true);
|
||||||
try {
|
try {
|
||||||
// Update profile to accept ecosystem license
|
// Update profile to accept ecosystem license
|
||||||
const res = await fetch(`/api/ethos/artists`, {
|
const res = await fetch(`${API_BASE}/api/ethos/artists`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
"x-user-id": user.id,
|
"x-user-id": user.id,
|
||||||
|
|
@ -315,7 +318,7 @@ export default function ArtistSettings() {
|
||||||
const fileUrl = await ethosStorage.uploadTrackFile(currentFile, user.id);
|
const fileUrl = await ethosStorage.uploadTrackFile(currentFile, user.id);
|
||||||
|
|
||||||
// Create track record in database
|
// Create track record in database
|
||||||
const res = await fetch(`/api/ethos/tracks`, {
|
const res = await fetch(`${API_BASE}/api/ethos/tracks`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"x-user-id": user.id,
|
"x-user-id": user.id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue