link-stack/apps/bridge-frontend/app/(main)/not-facebook/[[...segment]]/_actions/facebook.ts

51 lines
889 B
TypeScript
Raw Normal View History

2024-04-24 21:44:05 +02:00
"use server";
2024-04-25 12:31:03 +02:00
import { addAction, updateAction, deleteAction } from "@/app/_lib/actions";
const entity = "facebook";
const table = "FacebookBot";
2024-04-24 21:44:05 +02:00
export const addFacebookBotAction = async (
currentState: any,
formData: FormData,
) => {
2024-04-25 12:31:03 +02:00
return addAction({
entity,
table,
fields: [
"name",
"description",
"appId",
"appSecret",
"pageId",
"pageAccessToken",
],
currentState,
formData,
});
};
2024-04-24 21:44:05 +02:00
2024-04-25 12:31:03 +02:00
export const updateFacebookBotAction = async (
currentState: any,
formData: FormData,
) => {
return updateAction({
entity,
table,
fields: [
"name",
"description",
"appId",
"appSecret",
"pageId",
"pageAccessToken",
],
currentState,
formData,
});
};
2024-04-24 21:44:05 +02:00
2024-04-25 12:31:03 +02:00
export const deleteFacebookBotAction = async (id: string) => {
return deleteAction({ entity, table, id });
2024-04-24 21:44:05 +02:00
};