Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please replace pb.files.getUrl() with pb.files.getURL() #321

Closed
calumk opened this issue Nov 27, 2024 · 1 comment
Closed

Please replace pb.files.getUrl() with pb.files.getURL() #321

calumk opened this issue Nov 27, 2024 · 1 comment

Comments

@calumk
Copy link

calumk commented Nov 27, 2024

Please replace pb.getFileUrl() with pb.files.getURL()

If you replace it, you then get the following message, which i guess is an error.

Please replace pb.files.getUrl() with pb.files.getURL()

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Nov 27, 2024

I don't understand what is the issue here.

If you replace getUrl with getURL the warning should go away (see FileService.ts). You can also test it in the browser with the below pb_public/index.html:

<!DOCTYPE html />
<html>
<head>
    <meta charset="utf-8" />
    <title>Test</title>
</head>
<body>
    <script type="module">
        import PocketBase from "https://cdn.jsdelivr.net/gh/pocketbase/[email protected]/dist/pocketbase.es.mjs"

        const pb = new PocketBase("http://127.0.0.1:8090");

        const a = pb.files.getURL({id: "rid", collectionId: "cid"}, "fname");
        console.log("URL:", a)
    </script>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants