37 lines
671 B
TypeScript
37 lines
671 B
TypeScript
|
|
"use server";
|
||
|
|
|
||
|
|
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
|
||
|
|
|
||
|
|
const entity = "whatsapp";
|
||
|
|
const table = "WhatsappBot";
|
||
|
|
|
||
|
|
export const addWhatsappBotAction = async (
|
||
|
|
currentState: any,
|
||
|
|
formData: FormData,
|
||
|
|
) => {
|
||
|
|
return addAction({
|
||
|
|
entity,
|
||
|
|
table,
|
||
|
|
fields: ["name"],
|
||
|
|
currentState,
|
||
|
|
formData,
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
export const updateWhatsappBotAction = async (
|
||
|
|
currentState: any,
|
||
|
|
formData: FormData,
|
||
|
|
) => {
|
||
|
|
return updateAction({
|
||
|
|
entity,
|
||
|
|
table,
|
||
|
|
fields: ["name"],
|
||
|
|
currentState,
|
||
|
|
formData,
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
export const deleteWhatsappBotAction = async (id: string) => {
|
||
|
|
return deleteAction({ entity, table, id });
|
||
|
|
};
|