feat(web/server) public album sharing (#1266)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const prerender = false;
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
import { serverApi } from '@api';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
const { key } = params;
|
||||
|
||||
try {
|
||||
const { data: sharedLink } = await serverApi.shareApi.getMySharedLink({ params: { key } });
|
||||
return { sharedLink };
|
||||
} catch (e) {
|
||||
throw error(404, {
|
||||
message: 'Invalid shared link'
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user