link-stack/apps/bridge-frontend/app/(main)/signal/[[...segment]]/_actions/signal.ts

37 lines
676 B
TypeScript
Raw Normal View History

2024-04-25 12:31:03 +02:00
"use server";
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
2024-04-25 13:36:50 +02:00
const entity = "signal";
const table = "SignalBot";
2024-04-25 12:31:03 +02:00
export const addSignalBotAction = async (
currentState: any,
formData: FormData,
) => {
return addAction({
2024-04-25 13:36:50 +02:00
entity,
table,
2024-04-25 12:31:03 +02:00
fields: ["name", "description"],
currentState,
formData,
});
};
export const updateSignalBotAction = async (
currentState: any,
formData: FormData,
) => {
return updateAction({
2024-04-25 13:36:50 +02:00
entity,
table,
2024-04-25 12:31:03 +02:00
fields: ["name"],
currentState,
formData,
});
};
2024-04-25 13:36:50 +02:00
export const deleteSignalBotAction = async (id: string) => {
return deleteAction({ entity, table, id });
2024-04-25 12:31:03 +02:00
};