Edit and actions updates

This commit is contained in:
Darren Clarke 2024-04-25 12:31:03 +02:00
parent 0997e449bb
commit f87bcc43a5
30 changed files with 759 additions and 139 deletions

View file

@ -0,0 +1,33 @@
"use server";
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
const entity = "users";
const table = "User";
export const addUserAction = async (currentState: any, formData: FormData) => {
return addAction({
entity,
table,
fields: ["name"],
currentState,
formData,
});
};
export const updateUserAction = async (
currentState: any,
formData: FormData,
) => {
return updateAction({
entity,
table,
fields: ["name"],
currentState,
formData,
});
};
export const deleteUserAction = async (id: string) => {
return deleteAction({ entity, table, id });
};