link-stack/apps/bridge-frontend/app/(main)/webhooks/_actions/webhooks.ts
2024-04-25 12:31:03 +02:00

36 lines
655 B
TypeScript

"use server";
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
const entity = "webhooks";
const table = "Webhook";
export const addWebhookAction = async (
currentState: any,
formData: FormData,
) => {
return addAction({
entity,
table,
fields: ["name"],
currentState,
formData,
});
};
export const updateWebhookAction = async (
currentState: any,
formData: FormData,
) => {
return updateAction({
entity,
table,
fields: ["name"],
currentState,
formData,
});
};
export const deleteWebhookAction = async (id: string) => {
return deleteAction({ entity, table, id });
};