minor change
This commit is contained in:
parent
988d647521
commit
0579395e93
|
@ -1,7 +1,6 @@
|
||||||
import type { NextApiRequest, NextApiResponse } from "next";
|
import type { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { prisma } from "@/lib/api/db";
|
import { prisma } from "@/lib/api/db";
|
||||||
import readFile from "@/lib/api/storage/readFile";
|
import readFile from "@/lib/api/storage/readFile";
|
||||||
import verifyUser from "@/lib/api/verifyUser";
|
|
||||||
import { getToken } from "next-auth/jwt";
|
import { getToken } from "next-auth/jwt";
|
||||||
|
|
||||||
export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
||||||
|
@ -16,6 +15,7 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
||||||
const token = await getToken({ req });
|
const token = await getToken({ req });
|
||||||
const userId = token?.id;
|
const userId = token?.id;
|
||||||
|
|
||||||
|
if (req.method === "GET") {
|
||||||
const targetUser = await prisma.user.findUnique({
|
const targetUser = await prisma.user.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: queryId,
|
id: queryId,
|
||||||
|
@ -70,3 +70,4 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
||||||
.status(status as number)
|
.status(status as number)
|
||||||
.send(file);
|
.send(file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue