37 lines
655 B
TypeScript
37 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 });
|
||
|
|
};
|