refactor(frontend): split endpoint handling
This commit is contained in:
12
frontend/src/utils/api/client.ts
Normal file
12
frontend/src/utils/api/client.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
const API_URL = import.meta.env.VITE_API_URL;
|
||||
|
||||
class AuthError extends Error {
|
||||
constructor() { super("Not authenticated"); this.name = "AuthError"; }
|
||||
}
|
||||
|
||||
const isThumbnailAvailable = async (thumbnailUrl: string): Promise<boolean> => {
|
||||
const response = await fetch(thumbnailUrl, { credentials: 'include' });
|
||||
return response.ok;
|
||||
};
|
||||
|
||||
export { API_URL, AuthError, isThumbnailAvailable };
|
||||
Reference in New Issue
Block a user