fix: Use next/link instead of the wrong lucide-react import
fix: correct card cacher's priority order and saving
This commit is contained in:
@@ -100,7 +100,7 @@ export function CharacterChooser({
|
||||
return (
|
||||
<>
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="uid">UID</Label>
|
||||
<Label htmlFor="uid">UID*</Label>
|
||||
<Input
|
||||
id="uid"
|
||||
name="uid"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { Link } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { Link } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
||||
Regular → Executable
+13
-5
@@ -12,7 +12,7 @@ export async function GET(
|
||||
db.select().from(submissions).where(eq(submissions.id, subId)),
|
||||
db.select().from(cards).where(eq(cards.submission, subId)),
|
||||
]);
|
||||
if (image && image.image) return new Response(new Uint8Array(image.image));
|
||||
if (image?.image) return new Response(new Uint8Array(image.image));
|
||||
const [char] = await db
|
||||
.select()
|
||||
.from(characters)
|
||||
@@ -25,10 +25,18 @@ export async function GET(
|
||||
if (!card.ok) return card;
|
||||
const fresh = await card.arrayBuffer();
|
||||
after(async () => {
|
||||
await db.insert(cards).values({
|
||||
image: Buffer.from(fresh),
|
||||
submission: subId,
|
||||
});
|
||||
await db
|
||||
.insert(cards)
|
||||
.values({
|
||||
image: Buffer.from(fresh),
|
||||
submission: subId,
|
||||
})
|
||||
.onConflictDoUpdate({
|
||||
target: cards.submission,
|
||||
set: {
|
||||
image: Buffer.from(fresh),
|
||||
},
|
||||
});
|
||||
});
|
||||
return new Response(fresh);
|
||||
}
|
||||
|
||||
Regular → Executable
+1
-1
@@ -216,8 +216,8 @@ async function cacheCards() {
|
||||
),
|
||||
)
|
||||
.orderBy(
|
||||
asc(submissions.queue),
|
||||
asc(sql`coalesce(${cards.tries}, 0)`),
|
||||
asc(submissions.queue),
|
||||
asc(submissions.id),
|
||||
)
|
||||
.limit(1);
|
||||
|
||||
Reference in New Issue
Block a user