comissions-app-ui/services/DiscoveryService.ts

41 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2024-02-13 01:47:26 -05:00
export async function fetchArtistPortfolio(id): Promise<any> {
2024-02-13 01:47:26 -05:00
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${id}/Portfolio`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
}
return await response.json();
}
2024-02-11 20:44:27 -05:00
export async function fetchServicePortfolio(sellerId, serviceId): Promise<any> {
2024-02-13 01:47:26 -05:00
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}/Portfolio`;
2024-02-11 20:44:27 -05:00
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
}
return await response.json();
}
export async function fetchService(sellerId, serviceId): Promise<any> {
2024-02-13 01:47:26 -05:00
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}`;
2024-02-11 20:44:27 -05:00
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
}
return await response.json();
}
export function getPortfolioUrl(id, pieceId): string {
2024-02-13 01:47:26 -05:00
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${id}/Portfolio/${pieceId}`;
return url;
}