I've a route at src/pages/[slug].astro
but when I go to routes like http://localhost:4321/admin/posts/new
the app is kind of rendering the slug page I thing?
because, this is the code for my slug page
---
import BaseLayout from "../layouts/BaseLayout.astro";
import BlogPostLayout from "../layouts/BlogPostLayout.astro";
import { pocketbase } from "../lib/pb/pocketbase";
const { slug } = Astro.params;
let post = await pocketbase
.collection("posts")
.getFirstListItem(`slug="${slug}"`);
---
<BaseLayout>
<BlogPostLayout>
<h1>{post.title}</h1>
<Fragment set:html={post.content} />
</BlogPostLayout>
</BaseLayout>
so when I visit the http://localhost:4321/admin/posts/new an error is thrown from this function for getting post.
What could be the issue?