completionId: cgen-952a6feea5a94bbda17738c67a6f48c0
cgen-952a6feea5a94bbda17738c67a6f48c0
This commit is contained in:
parent
c7b3142e6e
commit
079f0c17ea
1 changed files with 25 additions and 3 deletions
|
|
@ -54,13 +54,35 @@ export default function AudioServicesForHire() {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// Fetch artists who are for_hire
|
// Fetch artists who are for_hire
|
||||||
const response = await fetch(`/api/ethos/artists?for_hire=true&limit=20`);
|
const response = await fetch(`/api/ethos/artists?forHire=true&limit=50`);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const result = await response.json();
|
||||||
setArtists(Array.isArray(data) ? data : []);
|
const artistsData = result.data || result || [];
|
||||||
|
|
||||||
|
// Map the response to expected format
|
||||||
|
const mappedArtists = artistsData.map((artist: any) => ({
|
||||||
|
id: artist.user_id,
|
||||||
|
user_id: artist.user_id,
|
||||||
|
full_name: artist.user_profiles?.full_name || "Unknown Artist",
|
||||||
|
avatar_url: artist.user_profiles?.avatar_url,
|
||||||
|
bio: artist.bio,
|
||||||
|
skills: artist.skills || [],
|
||||||
|
verified: artist.verified || false,
|
||||||
|
rating: 5.0, // Default rating - could be fetched from a ratings table
|
||||||
|
for_hire: artist.for_hire,
|
||||||
|
price_list: artist.price_list || {
|
||||||
|
track_custom: artist.sample_price_track,
|
||||||
|
sfx_pack: artist.sample_price_sfx,
|
||||||
|
full_score: artist.sample_price_score,
|
||||||
|
},
|
||||||
|
turnaround_days: artist.turnaround_days,
|
||||||
|
}));
|
||||||
|
|
||||||
|
setArtists(mappedArtists);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch artists:", error);
|
console.error("Failed to fetch artists:", error);
|
||||||
|
setArtists([]);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue