first commit
This commit is contained in:
23
app/(panel)/tickets/update/[id]/page.tsx
Normal file
23
app/(panel)/tickets/update/[id]/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { API_URL } from "@/core/constant";
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
async function getTicket(id: string) {
|
||||
const res = await fetch(`${API_URL}/ticket/get/${id}`, {
|
||||
cache: "no-store", // برای اینکه همیشه دیتای تازه از سرور بگیرد
|
||||
});
|
||||
if (!res.ok) {
|
||||
throw new Error("Error");
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
return data;
|
||||
}
|
||||
|
||||
export default async function Page({ params }: PageProps) {
|
||||
const { id } = await params;
|
||||
const getdata = await getTicket(id);
|
||||
console.log(getdata)
|
||||
return <div></div>;
|
||||
}
|
||||
Reference in New Issue
Block a user