refactor: switch SDK methods to asynchronous
Migrate SDK interactions to asynchronous calls, relax admin setup email constraints, and add event retrieval functionality.
This commit is contained in:
1 parent
81c5e4e2fd
commit
bb938c33c0
36 files changed
+1679
-754
No files matched your search
@@ -3,7 +3,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const settings = SettingsManager.getPublicSettings();
|
||||
const settings = await SettingsManager.getPublicSettingsAsync();
|
||||
return NextResponse.json({ settings });
|
||||
} catch (err: unknown) {
|
||||
const message = err instanceof Error ? err.message : "Settings read failed";
|
||||
@@ -14,9 +14,10 @@ export async function GET() {
|
||||
export async function POST(req: NextRequest) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
SettingsManager.updateSettings(body);
|
||||
await SettingsManager.updateSettingsAsync(body);
|
||||
const settings = await SettingsManager.getPublicSettingsAsync();
|
||||
return NextResponse.json({
|
||||
settings: SettingsManager.getPublicSettings(),
|
||||
settings,
|
||||
success: true,
|
||||
});
|
||||
} catch (err: unknown) {
|
||||
|
||||
Reference in new issue
Block a user