first commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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().updateMe({
|
||||
name: body.name,
|
||||
title: body.title,
|
||||
avatarColor: body.avatarColor,
|
||||
avatarUrl: body.avatarUrl,
|
||||
presence: body.presence,
|
||||
});
|
||||
return NextResponse.json({ user });
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user