* Move frontend to root * Fix backend issues * Remove old routes * Setup Dockerfile * Fix today /tags multiplt requests issue * Fix race condition on today's inbox widget * Fix cors development issue * Fix CORS for Dockerfile * Fix dockerised settings for infinite loop * Fix translation issues * fixup! Fix translation issues --------- Co-authored-by: Your Name <you@example.com>
18 lines
473 B
TypeScript
18 lines
473 B
TypeScript
export const fetcher = async (url: string) => {
|
|
const response = await fetch(url, {
|
|
credentials: 'include',
|
|
headers: {
|
|
'Accept': 'application/json',
|
|
},
|
|
});
|
|
|
|
if (!response.ok) {
|
|
const errorData = await response.json();
|
|
const error = new Error(errorData.error || 'An error occurred while fetching the data.');
|
|
(error as any).info = errorData;
|
|
(error as any).status = response.status;
|
|
throw error;
|
|
}
|
|
|
|
return response.json();
|
|
};
|