50 lines
889 B
TypeScript
50 lines
889 B
TypeScript
"use server";
|
|
|
|
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
|
|
|
|
const entity = "facebook";
|
|
const table = "FacebookBot";
|
|
|
|
export const addFacebookBotAction = async (
|
|
currentState: any,
|
|
formData: FormData,
|
|
) => {
|
|
return addAction({
|
|
entity,
|
|
table,
|
|
fields: [
|
|
"name",
|
|
"description",
|
|
"appId",
|
|
"appSecret",
|
|
"pageId",
|
|
"pageAccessToken",
|
|
],
|
|
currentState,
|
|
formData,
|
|
});
|
|
};
|
|
|
|
export const updateFacebookBotAction = async (
|
|
currentState: any,
|
|
formData: FormData,
|
|
) => {
|
|
return updateAction({
|
|
entity,
|
|
table,
|
|
fields: [
|
|
"name",
|
|
"description",
|
|
"appId",
|
|
"appSecret",
|
|
"pageId",
|
|
"pageAccessToken",
|
|
],
|
|
currentState,
|
|
formData,
|
|
});
|
|
};
|
|
|
|
export const deleteFacebookBotAction = async (id: string) => {
|
|
return deleteAction({ entity, table, id });
|
|
};
|