Added impersonation for admins
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import fetchUserUsingAPI from "@/lib/validate-api";
|
||||
import fetchUser from "@/lib/fetch-user";
|
||||
import { db } from "@/lib/db"
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
@ -8,7 +8,7 @@ export async function GET(req: Request) {
|
||||
let userId = searchParams.get('userId')
|
||||
|
||||
if (userId == null) {
|
||||
const user = await fetchUserUsingAPI(req);
|
||||
const user = await fetchUser(req);
|
||||
if (user != null) {
|
||||
userId = user.id as string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user