[PIE-28] Switch to type-safe API #12
@ -7,17 +7,6 @@ import {
|
|||||||
Collection
|
Collection
|
||||||
} from './schema'
|
} from './schema'
|
||||||
|
|
||||||
const raw_client = new Pocketbase("http://localhost:4321")
|
|
||||||
raw_client.autoCancellation(false)
|
|
||||||
|
|
||||||
// Return a relative url for file instead of full path including localhost, which breaks external access
|
|
||||||
raw_client.files.getRelativeURL = (record: { [key: string]: any; }, filename: string, queryParams?: FileOptions | undefined) => {
|
|
||||||
const res = raw_client.files.getURL(record, filename)
|
|
||||||
return res.substring(21)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { raw_client };
|
|
||||||
|
|
||||||
class APIClient {
|
class APIClient {
|
||||||
client: Pocketbase
|
client: Pocketbase
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user