Update query parameter in LatestScripts.tsx, Navbar.tsx, Script.tsx, and ScriptBrowser.tsx to use item title instead of item id

This commit is contained in:
Bram Suurd
2024-05-18 22:09:36 +02:00
parent 0387a34a1d
commit f35c2263ad
4 changed files with 4 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ function LatestScripts() {
<Link
href={{
pathname: "/scripts",
query: { id: item.id },
query: { id: item.title },
}}
className="text-muted-foreground"
>

View File

@@ -147,7 +147,7 @@ function Navbar() {
<Link
href={{
pathname: "/scripts",
query: { id: script.id },
query: { id: script.title },
}}
className="flex justify-between text-muted-foreground"
>

View File

@@ -18,7 +18,7 @@ function ScriptItem() {
const id = useSearchParams().get("id");
const getItem = async () => {
const res = await pb.collection("proxmox_scripts").getOne(`${id}`, {});
const res = await pb.collection('proxmox_scripts').getFirstListItem(`title="${id}"`);
setItem(res as unknown as Script);
};

View File

@@ -90,7 +90,7 @@ const ScriptBrowser = () => {
<Link
href={{
pathname: "/scripts",
query: { id: script.id },
query: { id: script.title },
}}
className="flex cursor-pointer items-center justify-between gap-1 text-muted-foreground"
>