33 lines
633 B
TypeScript
33 lines
633 B
TypeScript
"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 });
|
|
};
|