2024-02-11 02:20:39 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-13 01:47:26 -05:00
|
|
|
|
2024-02-11 02:20:39 -05:00
|
|
|
|
|
|
|
export async function fetchSellerPortfolio(id): Promise<any> {
|
2024-02-13 01:47:26 -05:00
|
|
|
|
|
|
|
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${id}/Portfolio`;
|
2024-02-11 02:20:39 -05:00
|
|
|
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/Sellers/${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/Sellers/${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();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-02-11 02:20:39 -05:00
|
|
|
export function getPortfolioUrl(id, pieceId): string {
|
2024-02-13 01:47:26 -05:00
|
|
|
|
|
|
|
var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${id}/Portfolio/${pieceId}`;
|
2024-02-11 02:20:39 -05:00
|
|
|
return url;
|
|
|
|
}
|