Add CRUD for other entities
This commit is contained in:
parent
f87bcc43a5
commit
a3e8b89128
64 changed files with 949 additions and 62 deletions
|
|
@ -0,0 +1,36 @@
|
|||
"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 });
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue