Refactor: Fully migrated to direct PostgreSQL, implemented Public API v1, fixed Vercel deployment conflicts, and updated documentation

This commit is contained in:
mstfyldz
2026-03-12 21:54:57 +03:00
parent 321f25a15c
commit 515d513c1f
29 changed files with 1002 additions and 675 deletions

View File

@@ -1,5 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { supabaseAdmin } from '@/lib/supabase-admin';
import { db } from '@/lib/db';
export async function POST(req: NextRequest) {
try {
@@ -9,18 +9,10 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ error: 'Missing stripe_id' }, { status: 400 });
}
const { error } = await supabaseAdmin
.from('transactions')
.update({
customer_name,
customer_phone
})
.eq('stripe_pi_id', stripe_id);
if (error) {
console.error('Update transaction info error:', error);
return NextResponse.json({ error: error.message }, { status: 500 });
}
await db.query(
'UPDATE transactions SET customer_name = $1, customer_phone = $2 WHERE stripe_pi_id = $3',
[customer_name, customer_phone, stripe_id]
);
return NextResponse.json({ success: true });
} catch (err: any) {