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

@@ -8,7 +8,7 @@ import {
ShieldCheck
} from 'lucide-react';
import MerchantSidebar from '@/components/merchant/MerchantSidebar';
import { supabaseAdmin } from '@/lib/supabase-admin';
import { db } from '@/lib/db';
export default async function MerchantLayout({
children,
@@ -26,11 +26,8 @@ export default async function MerchantLayout({
let resolvedId = identifier;
if (!isUUID) {
const { data: merchant } = await supabaseAdmin
.from('merchants')
.select('id')
.eq('short_id', identifier)
.single();
const result = await db.query('SELECT id FROM merchants WHERE short_id = $1 LIMIT 1', [identifier]);
const merchant = result.rows[0];
if (merchant) {
resolvedId = merchant.id;
}