fix: logo broken in metadata images, rename methods

This commit is contained in:
trafficlunar 2026-04-18 18:38:46 +01:00
parent 59d2b0b2c1
commit 94eef81b93
8 changed files with 32 additions and 32 deletions

View file

@ -4,7 +4,7 @@ import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma"; import { prisma } from "@/lib/prisma";
import { RateLimit } from "@/lib/rate-limit"; import { RateLimit } from "@/lib/rate-limit";
export async function DELETE(request: NextRequest) { export async function POST(request: NextRequest) {
const session = await auth(); const session = await auth();
if (!session || !session.user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); if (!session || !session.user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });

View file

@ -10,7 +10,7 @@ import { RateLimit } from "@/lib/rate-limit";
const uploadsDirectory = path.join(process.cwd(), "uploads", "mii"); const uploadsDirectory = path.join(process.cwd(), "uploads", "mii");
export async function DELETE(request: NextRequest, { params }: { params: Promise<{ id: string }> }) { export async function POST(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
const session = await auth(); const session = await auth();
if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });

View file

@ -4,7 +4,7 @@ import { auth } from "@/lib/auth";
import { RateLimit } from "@/lib/rate-limit"; import { RateLimit } from "@/lib/rate-limit";
import { prisma } from "@/lib/prisma"; import { prisma } from "@/lib/prisma";
export async function DELETE(request: NextRequest) { export async function POST(request: NextRequest) {
const session = await auth(); const session = await auth();
if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });

View file

@ -190,7 +190,7 @@ export async function generateMetadataImage(mii: Mii, author: string): Promise<{
{/* Watermark */} {/* Watermark */}
<div tw="absolute bottom-0 right-0 flex items-center"> <div tw="absolute bottom-0 right-0 flex items-center">
<img src={`${process.env.NEXT_PUBLIC_BASE_URL}/logo.svg`} height={32} /> <img src={`${process.env.NEXT_PUBLIC_FRONTEND_URL}/logo.svg`} height={32} />
{/* I tried using text-orange-400 but it wasn't correct..? */} {/* I tried using text-orange-400 but it wasn't correct..? */}
<span tw="ml-2 font-black text-xl" style={{ color: "#FF8904" }}> <span tw="ml-2 font-black text-xl" style={{ color: "#FF8904" }}>
TomodachiShare TomodachiShare

View file

@ -1,25 +1,25 @@
import { useState } from "react"; import { useState } from "react";
export default function BannerForm() { export default function BannerForm() {
const [message, setMessage] = useState(""); const [message, setMessage] = useState("");
const onClickClear = async () => { const onClickClear = async () => {
await fetch("/api/admin/banner", { method: "DELETE" }); await fetch("/api/admin/banner", { method: "DELETE" });
}; };
const onClickSet = async () => { const onClickSet = async () => {
await fetch("/api/admin/banner", { method: "POST", body: message }); await fetch("/api/admin/banner", { method: "POST", body: message });
}; };
return ( return (
<div className="bg-orange-100 rounded-xl border-2 border-orange-400 p-2 flex gap-2"> <div className="bg-orange-100 rounded-xl border-2 border-orange-400 p-2 flex gap-2">
<input type="text" className="pill input w-full" placeholder="Enter banner text" value={message} onChange={(e) => setMessage(e.target.value)} /> <input type="text" className="pill input w-full" placeholder="Enter banner text" value={message} onChange={(e) => setMessage(e.target.value)} />
<button type="button" className="pill button" onClick={onClickClear}> <button type="button" className="pill button" onClick={onClickClear}>
Clear Clear
</button> </button>
<button type="submit" className="pill button" onClick={onClickSet}> <button type="submit" className="pill button" onClick={onClickSet}>
Set Set
</button> </button>
</div> </div>
); );
} }

View file

@ -11,7 +11,7 @@
// const [error, setError] = useState<string | undefined>(undefined); // const [error, setError] = useState<string | undefined>(undefined);
// const handleClick = async () => { // const handleClick = async () => {
// const response = await fetch("/api/return", { method: "DELETE" }); // const response = await fetch("/api/return", { method: "POST" });
// if (!response.ok) { // if (!response.ok) {
// const data = await response.json(); // const data = await response.json();

View file

@ -22,7 +22,7 @@ export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Pr
const [inputMiiName, setInputMiiName] = useState(""); const [inputMiiName, setInputMiiName] = useState("");
const handleSubmit = async () => { const handleSubmit = async () => {
const response = await fetch(`${import.meta.env.VITE_API_URL}/api/mii/${miiId}/delete`, { method: "DELETE", credentials: "include" }); const response = await fetch(`${import.meta.env.VITE_API_URL}/api/mii/${miiId}/delete`, { method: "POST", credentials: "include" });
if (!response.ok) { if (!response.ok) {
const { error } = await response.json(); const { error } = await response.json();
setError(error); setError(error);

View file

@ -12,7 +12,7 @@ export default function DeleteAccount() {
const [error, setError] = useState<string | undefined>(undefined); const [error, setError] = useState<string | undefined>(undefined);
const handleSubmit = async () => { const handleSubmit = async () => {
const response = await fetch(`${import.meta.env.VITE_API_URL}/api/auth/delete`, { method: "DELETE", credentials: "include" }); const response = await fetch(`${import.meta.env.VITE_API_URL}/api/auth/delete`, { method: "POST", credentials: "include" });
if (!response.ok) { if (!response.ok) {
const { error } = await response.json(); const { error } = await response.json();
setError(error); setError(error);