fix(art): dont count donate queues
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { TooltipTrigger } from "@radix-ui/react-tooltip";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { eq, isNotNull, sql } from "drizzle-orm";
|
||||
import {
|
||||
BookAlert,
|
||||
CircleDollarSign,
|
||||
@@ -62,7 +62,11 @@ export default async function ArtifactFormPage({
|
||||
.from(characters)
|
||||
.orderBy(characters.name);
|
||||
const config = await getArtifactConfig();
|
||||
const count = await db.$count(submissions);
|
||||
const count = await db
|
||||
.select({ a: sql`NULL` })
|
||||
.from(submissions)
|
||||
.where(isNotNull(submissions.queue))
|
||||
.then((e) => e.length);
|
||||
const { edit: searchEdit } = await searchParams;
|
||||
const editing = q && searchEdit === q.editToken && q.edits < 5;
|
||||
|
||||
|
||||
+5
-1
@@ -87,7 +87,11 @@ export async function submitArtifact(
|
||||
) {
|
||||
const config = await getArtifactConfig();
|
||||
if (config.locked) return "ปิดรับลงทะเบียนชั่วคราว เนื่องจากมีผู้ลงจำนวนมาก";
|
||||
const count = await db.$count(submissions);
|
||||
const count = await db
|
||||
.select({ a: sql`NULL` })
|
||||
.from(submissions)
|
||||
.where(isNotNull(submissions.queue))
|
||||
.then((e) => e.length);
|
||||
if (config.limit !== -1 && count >= config.limit)
|
||||
return `คิวลงทะเบียนเต็มแล้ว (${config.limit} ครั้ง)`;
|
||||
const { success, data, error } = await ArtifactSubmission(
|
||||
|
||||
Reference in New Issue
Block a user