mirror of
https://github.com/D4M13N-D3V/comissions-app-ui.git
synced 2025-03-13 15:55:08 +00:00
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
|
|
|
|
|
|
|
|
|
|
export async function fetchArtistPortfolio(id): Promise<any> {
|
|
|
|
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();
|
|
}
|
|
|
|
export async function fetchServicePortfolio(sellerId, serviceId): Promise<any> {
|
|
|
|
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}/Portfolio`;
|
|
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> {
|
|
|
|
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}`;
|
|
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 {
|
|
|
|
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${id}/Portfolio/${pieceId}`;
|
|
return url;
|
|
} |