init
This commit is contained in:
15
frontend/components/action.ts
Normal file
15
frontend/components/action.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
"use server";
|
||||
|
||||
const apiUrl = process.env.NEXT_SERVER_API_URL;
|
||||
|
||||
export async function deleteVorlageFlaechendruck(id: number) {
|
||||
const res = await fetch(`${apiUrl}/vorlageFlaechendruck/delete/${id}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error("Failed to delete item");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user