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:
@@ -59,7 +59,7 @@ function LatestScripts() {
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/scripts",
|
||||
query: { id: item.id },
|
||||
query: { id: item.title },
|
||||
}}
|
||||
className="text-muted-foreground"
|
||||
>
|
||||
|
||||
@@ -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"
|
||||
>
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user