drop active
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import pool from '@/lib/db'
|
||||
|
||||
// GET /api/drops/active - Get the currently active drop (not sold out)
|
||||
// GET /api/drops/active - Get the earliest unfilled drop (not sold out)
|
||||
export async function GET() {
|
||||
try {
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT * FROM drops WHERE fill < size ORDER BY created_at DESC LIMIT 1'
|
||||
'SELECT * FROM drops WHERE fill < size ORDER BY created_at ASC LIMIT 1'
|
||||
)
|
||||
|
||||
const drops = rows as any[]
|
||||
|
||||
Reference in New Issue
Block a user