link-stack/apps/bridge-frontend/app/(main)/users/_actions/users.ts
2024-04-25 12:31:03 +02:00

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 });
};