adds search api
This commit is contained in:
3
web/src/lib/util/array_util.ts
Normal file
3
web/src/lib/util/array_util.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function range(to: number, from: number = 0): ReadonlyArray<number> {
|
||||
return [...Array(to - from).keys()].map(i => i + from);
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import type { FileOptions } from "pocketbase";
|
||||
|
||||
export function getFileURL(record: { [key: string]: any; }, filename?: string, options?: FileOptions) {
|
||||
if(!filename) {
|
||||
export function getFileURL(record: { [key: string]: any; }, filename?: string) {
|
||||
if (!filename) {
|
||||
return "";
|
||||
}
|
||||
return pb.files.getUrl(record, filename, options);
|
||||
|
||||
// return pb.files.getUrl(record, filename);
|
||||
return `/api/v1/files/${record.collectionId}/${record.id}/${filename}`
|
||||
}
|
||||
Reference in New Issue
Block a user