feat:incrase text limit in artifact

This commit is contained in:
2026-02-28 21:08:50 +07:00 Unverified
parent 0063bd3e3a
commit 073c43ea94
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ export default async function ArtifactFormPage() {
type="text" type="text"
placeholder="Mr.Buzz" placeholder="Mr.Buzz"
autoComplete="name" autoComplete="name"
maxLength={32} maxLength={64}
required required
/> />
</div> </div>
@@ -144,7 +144,7 @@ export default async function ArtifactFormPage() {
name="comment" name="comment"
placeholder="เช่น Er พอไหมครับ, คริสวยยังครับ (ไม่บังคับ)" placeholder="เช่น Er พอไหมครับ, คริสวยยังครับ (ไม่บังคับ)"
className="bg-card!" className="bg-card!"
maxLength={512} maxLength={1024}
/> />
</div> </div>
</div> </div>
+3 -3
View File
@@ -49,9 +49,9 @@ export async function submitArtifact(formData: FormData) {
const character = form.get("character")?.toString(); const character = form.get("character")?.toString();
const comment = form.get("comment")?.toString() || ""; const comment = form.get("comment")?.toString() || "";
if (!name || !uid || !character) return "กรุณากรอกข้อมูลให้ครบถ้วน"; if (!name || !uid || !character) return "กรุณากรอกข้อมูลให้ครบถ้วน";
if (name.length > 32) return "ชื่อยาวเกินไป ต้องไม่เกิน 32 ตัวอักษร"; if (name.length > 64) return "ชื่อยาวเกินไป ต้องไม่เกิน 64 ตัวอักษร";
if (!uidRegex.test(uid)) return "UID ไม่ถูกต้อง ต้องเป็นเลข 9 หลัก"; if (!uidRegex.test(uid)) return "UID ไม่ถูกต้อง ต้องเป็นเลข 9 หรือ 10 หลัก เท่านั้น";
if (comment.length > 256) return "ข้อความเพิ่มเติมยาวเกินไป ต้องไม่เกิน 512 ตัวอักษร"; if (comment.length > 1024) return "ข้อความเพิ่มเติมยาวเกินไป ต้องไม่เกิน 1024 ตัวอักษร";
if (config.locked) return "ปิดรับลงทะเบียนชั่วคราว เนื่องจากมีผู้ลงจำนวนมาก"; if (config.locked) return "ปิดรับลงทะเบียนชั่วคราว เนื่องจากมีผู้ลงจำนวนมาก";
const count = await db.$count(submissions); const count = await db.$count(submissions);
if (config.limit !== -1 && count >= config.limit) if (config.limit !== -1 && count >= config.limit)
+3
View File
@@ -17,6 +17,9 @@ const nextConfig: NextConfig = withBundleAnalyzer({
{ {
hostname: "cdn.dgnr.us", hostname: "cdn.dgnr.us",
}, },
{
hostname: "cdn.gunshiz.top",
},
{ {
hostname: "i.ytimg.com", hostname: "i.ytimg.com",
}, },