mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-03-01 19:49:22 +00:00
Remove VITE_SERVER_ENDPOINT dependency (#428)
* 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
This commit is contained in:
@@ -4,10 +4,12 @@
|
||||
import type { Load } from '@sveltejs/kit';
|
||||
import { AlbumResponseDto, api, UserResponseDto } from '@api';
|
||||
|
||||
export const load: Load = async () => {
|
||||
export const load: Load = async ({ fetch }) => {
|
||||
try {
|
||||
const { data: user } = await api.userApi.getMyUserInfo();
|
||||
const { data: sharedAlbums } = await api.albumApi.getAllAlbums(true);
|
||||
const [user, sharedAlbums] = await Promise.all([
|
||||
fetch('/data/user/get-my-user-info').then((r) => r.json()),
|
||||
fetch('/data/album/get-all-albums?isShared=true').then((r) => r.json())
|
||||
]);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
|
||||
Reference in New Issue
Block a user