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:
Alex
2022-08-06 18:14:54 -05:00
committed by GitHub
parent cf2b9eddfa
commit b68358766b
23 changed files with 152 additions and 66 deletions

View File

@@ -2,10 +2,12 @@
import type { Load } from '@sveltejs/kit';
import { api, UserResponseDto } from '@api';
export const load: Load = async () => {
export const load: Load = async ({ fetch }) => {
try {
const { data: allUsers } = await api.userApi.getAllUsers(false);
const { data: user } = await api.userApi.getMyUserInfo();
const [user, allUsers] = await Promise.all([
fetch('/data/user/get-my-user-info').then((r) => r.json()),
fetch('/data/user/get-all-users?isAll=false').then((r) => r.json())
]);
return {
status: 200,