feat(server): improve API specification (#1853)

This commit is contained in:
Michel Heusschen
2023-02-24 17:01:10 +01:00
committed by GitHub
parent da9b9c8c69
commit 9323cc76d9
41 changed files with 1690 additions and 396 deletions

View File

@@ -12,7 +12,7 @@ export const load: PageServerLoad = async ({ params, parent }) => {
const { key } = params;
try {
const { data: sharedLink } = await api.shareApi.getMySharedLink({ params: { key } });
const { data: sharedLink } = await api.shareApi.getMySharedLink(key);
const assetCount = sharedLink.assets.length;
const assetId = sharedLink.album?.albumThumbnailAssetId || sharedLink.assets[0]?.id;

View File

@@ -7,9 +7,7 @@ import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ params }) => {
try {
const { key, assetId } = params;
const { data: asset } = await api.assetApi.getAssetById(assetId, {
params: { key }
});
const { data: asset } = await api.assetApi.getAssetById(assetId, key);
if (!asset) {
return error(404, 'Asset not found');