15 lines
432 B
TypeScript
15 lines
432 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { getBackend } from "@/lib/backend";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function PATCH(req: NextRequest) {
|
|
const body = await req.json().catch(() => ({}));
|
|
const user = await getBackend().setStatus(
|
|
body.statusText ?? undefined,
|
|
body.statusEmoji ?? undefined,
|
|
body.clearAt ?? undefined,
|
|
);
|
|
return NextResponse.json({ user });
|
|
}
|