File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/web/src/app/api/(server)/ee/user Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,20 @@ import { NextRequest } from "next/server";
1414const logger = createLogger ( 'ee-user-api' ) ;
1515const auditService = getAuditService ( ) ;
1616
17- export const GET = apiHandler ( async ( ) => {
18- const result = await withAuthV2 ( async ( { org, role, user, prisma } ) => {
17+ export const GET = apiHandler ( async ( request : NextRequest ) => {
18+ const url = new URL ( request . url ) ;
19+ const userId = url . searchParams . get ( 'userId' ) ;
20+
21+ if ( ! userId ) {
22+ return serviceErrorResponse ( missingQueryParam ( 'userId' ) ) ;
23+ }
24+
25+ const result = await withAuthV2 ( async ( { org, role, prisma } ) => {
1926 return withMinimumOrgRole ( role , OrgRole . OWNER , async ( ) => {
2027 try {
2128 const userData = await prisma . user . findUnique ( {
2229 where : {
23- id : user . id ,
30+ id : userId ,
2431 } ,
2532 select : {
2633 name : true ,
@@ -49,7 +56,7 @@ export const GET = apiHandler(async () => {
4956
5057 return userData ;
5158 } catch ( error ) {
52- logger . error ( 'Error fetching user info' , { error, userId : user . id } ) ;
59+ logger . error ( 'Error fetching user info' , { error, userId } ) ;
5360 throw error ;
5461 }
5562 } ) ;
You can’t perform that action at this time.
0 commit comments