Update Site source

This commit is contained in:
Meghdad committed 2026-10-12 23:20:56 +03:30
commit 9a4ce930c7
126 files changed
+25723

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
import { env } from 'cloudflare:workers';
import { getChatGPTUser } from '../app/chatgpt-auth';
import { seed, merge } from './ledger.mjs';
export async function isAdmin(){const user=await getChatGPTUser();const email=(env as unknown as {ADMIN_EMAIL?:string}).ADMIN_EMAIL;return !!(email&&user&&user.email.toLowerCase()===email.toLowerCase());}
export async function readLedger(){if(!env.DB)throw Error('پایگاه داده در دسترس نیست.');const result=await env.DB.prepare('SELECT id,date,player,reason,amount FROM transactions ORDER BY date DESC').all();return merge([...seed,...result.results]);}