mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-10 11:15:49 +00:00
* Move backend api to its own instance * Remove external fetch hook * Added endpoint for album * Added endpoint for admin page * Make request directly to immich-server * Refactor unsued code
19 lines
478 B
TypeScript
19 lines
478 B
TypeScript
import { AlbumResponseDto, serverApi } from '@api';
|
|
import type { RequestEvent, RequestHandler, RequestHandlerOutput } from '@sveltejs/kit';
|
|
|
|
export const GET = async ({
|
|
url
|
|
}: RequestEvent): Promise<RequestHandlerOutput<AlbumResponseDto[]>> => {
|
|
try {
|
|
const isShared = url.searchParams.get('isShared') === 'true' || undefined;
|
|
const { data } = await serverApi.albumApi.getAllAlbums(isShared);
|
|
return {
|
|
body: data
|
|
};
|
|
} catch {
|
|
return {
|
|
status: 500
|
|
};
|
|
}
|
|
};
|