mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
adhere to size limits for tables
This commit is contained in:
@@ -104,6 +104,13 @@ export async function POST(request: NextRequest, { params }: UpsertRouteParams)
|
||||
|
||||
const now = new Date()
|
||||
|
||||
if (!existingRow && table.rowCount >= table.maxRows) {
|
||||
return NextResponse.json(
|
||||
{ error: `Table row limit reached (${table.maxRows} rows max)` },
|
||||
{ status: 400 }
|
||||
)
|
||||
}
|
||||
|
||||
const upsertResult = await db.transaction(async (trx) => {
|
||||
if (existingRow) {
|
||||
const [updatedRow] = await trx
|
||||
|
||||
Reference in New Issue
Block a user