fp/services/next/app/lib/contributors.ts

23 lines
525 B
TypeScript
Raw Normal View History

2025-01-11 03:10:04 +00:00
import { postgrestLocalUrl } from "./constants";
2024-01-20 16:16:14 +00:00
import fetchAPI from "./fetch-api";
export interface IContributor {
id: number;
2025-01-11 03:10:04 +00:00
name: string;
url?: string;
isFinancialDonor: boolean;
isVodProvider: boolean;
2024-01-20 16:16:14 +00:00
}
export async function getContributors(): Promise<IContributor[]|null> {
try {
const res = await fetchAPI(`/contributors`);
return res.data;
} catch (e) {
console.error(`error while fetching contributors`)
console.error(e);
return null;
}
}