Replace PostgreSQL and Docker deployment with embedded Turso, Drizzle relational queries v2, native systemd deployment on port 43821, and fresh SQLite migrations.
Hop-State: A_06FP5KEDBTB4A9ZT7QB498G Hop-Proposal: R_06FP5KDWMCKVVMQZT4MVZ28 Hop-Task: T_06FP5DZ7T0G45FG93PT90B8 Hop-Attempt: AT_06FP5DZ7T0PKQW99V27JCV8
This commit is contained in:
@@ -13,7 +13,7 @@ export async function GET(req: NextRequest, context: RouteContext) {
|
||||
const { handle } = await context.params;
|
||||
|
||||
const targetUser = await db.query.users.findFirst({
|
||||
where: eq(users.handle, handle),
|
||||
where: { handle: handle },
|
||||
});
|
||||
|
||||
if (!targetUser) {
|
||||
@@ -21,10 +21,7 @@ export async function GET(req: NextRequest, context: RouteContext) {
|
||||
}
|
||||
|
||||
const block = await db.query.blocks.findFirst({
|
||||
where: and(
|
||||
eq(blocks.userId, currentUser.id),
|
||||
eq(blocks.blockedUserId, targetUser.id)
|
||||
),
|
||||
where: { AND: [{ userId: currentUser.id }, { blockedUserId: targetUser.id }] },
|
||||
});
|
||||
|
||||
return NextResponse.json({ blocked: !!block });
|
||||
@@ -44,7 +41,7 @@ export async function POST(req: NextRequest, context: RouteContext) {
|
||||
const { handle } = await context.params;
|
||||
|
||||
const targetUser = await db.query.users.findFirst({
|
||||
where: eq(users.handle, handle),
|
||||
where: { handle: handle },
|
||||
});
|
||||
|
||||
if (!targetUser) {
|
||||
@@ -57,10 +54,7 @@ export async function POST(req: NextRequest, context: RouteContext) {
|
||||
|
||||
// Check if already blocked
|
||||
const existing = await db.query.blocks.findFirst({
|
||||
where: and(
|
||||
eq(blocks.userId, currentUser.id),
|
||||
eq(blocks.blockedUserId, targetUser.id)
|
||||
),
|
||||
where: { AND: [{ userId: currentUser.id }, { blockedUserId: targetUser.id }] },
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
@@ -104,7 +98,7 @@ export async function DELETE(req: NextRequest, context: RouteContext) {
|
||||
const { handle } = await context.params;
|
||||
|
||||
const targetUser = await db.query.users.findFirst({
|
||||
where: eq(users.handle, handle),
|
||||
where: { handle: handle },
|
||||
});
|
||||
|
||||
if (!targetUser) {
|
||||
|
||||
Reference in New Issue
Block a user