updates readme
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import type { FileOptions } from "pocketbase";
|
||||
|
||||
export function getFileURL(record: { [key: string]: any; }, filename?: string) {
|
||||
if (!filename) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// return pb.files.getUrl(record, filename);
|
||||
return `/api/v1/files/${record.collectionId}/${record.id}/${filename}`
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { error, text, type RequestEvent } from "@sveltejs/kit";
|
||||
import { error, type RequestEvent } from "@sveltejs/kit";
|
||||
|
||||
export async function GET(event: RequestEvent) {
|
||||
const parts = [];
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
let activeTab = 0;
|
||||
|
||||
const thumbnail = $trail.photos.length
|
||||
? getFileURL(trail, $trail.photos[$trail.thumbnail])
|
||||
? getFileURL($trail, $trail.photos[$trail.thumbnail])
|
||||
: "/imgs/default_thumbnail.webp";
|
||||
|
||||
onMount(() => {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
let lightboxDataSource: DataSource;
|
||||
|
||||
const thumbnail = $trail.photos.length
|
||||
? getFileURL(trail, $trail.photos[$trail.thumbnail])
|
||||
? getFileURL($trail, $trail.photos[$trail.thumbnail])
|
||||
: "/imgs/default_thumbnail.webp";
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
Reference in New Issue
Block a user