link-stack/apps/bridge-frontend/app/(main)/signal/[[...segment]]/_actions/signal.ts
2024-04-25 13:36:50 +02:00

36 lines
676 B
TypeScript

"use server";
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
const entity = "signal";
const table = "SignalBot";
export const addSignalBotAction = async (
currentState: any,
formData: FormData,
) => {
return addAction({
entity,
table,
fields: ["name", "description"],
currentState,
formData,
});
};
export const updateSignalBotAction = async (
currentState: any,
formData: FormData,
) => {
return updateAction({
entity,
table,
fields: ["name"],
currentState,
formData,
});
};
export const deleteSignalBotAction = async (id: string) => {
return deleteAction({ entity, table, id });
};