mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 14:21:15 +00:00
addd TG integration
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { listAccounts, listChannels } from "@/lib/telegram/admin-queries";
|
||||
import { listAccounts, listChannels, getGlobalDestination } from "@/lib/telegram/admin-queries";
|
||||
import { getIngestionStatus } from "@/lib/telegram/queries";
|
||||
import { TelegramAdmin } from "./_components/telegram-admin";
|
||||
|
||||
export default async function TelegramPage() {
|
||||
@@ -8,10 +9,19 @@ export default async function TelegramPage() {
|
||||
if (!session?.user?.id) redirect("/login");
|
||||
if (session.user.role !== "ADMIN") redirect("/dashboard");
|
||||
|
||||
const [accounts, channels] = await Promise.all([
|
||||
const [accounts, channels, ingestionStatus, globalDestination] = await Promise.all([
|
||||
listAccounts(),
|
||||
listChannels(),
|
||||
getIngestionStatus(),
|
||||
getGlobalDestination(),
|
||||
]);
|
||||
|
||||
return <TelegramAdmin accounts={accounts} channels={channels} />;
|
||||
return (
|
||||
<TelegramAdmin
|
||||
accounts={accounts}
|
||||
channels={channels}
|
||||
ingestionStatus={ingestionStatus}
|
||||
globalDestination={globalDestination}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user