Skip to content

Commit

Permalink
Fixed team member lookup.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Feb 14, 2025
1 parent b3f7694 commit e015ce8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/api/teams/[teamId]/users/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod';
import { unauthorized, json, badRequest } from '@/lib/response';
import { canAddUserToTeam, canUpdateTeam } from '@/lib/auth';
import { canAddUserToTeam, canViewTeam } from '@/lib/auth';
import { parseRequest } from '@/lib/request';
import { pagingParams, roleParam } from '@/lib/schema';
import { createTeamUser, getTeamUser, getTeamUsers } from '@/queries';
Expand All @@ -18,7 +18,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ team

const { teamId } = await params;

if (!(await canUpdateTeam(auth, teamId))) {
if (!(await canViewTeam(auth, teamId))) {
return unauthorized('You must be the owner of this team.');
}

Expand Down

0 comments on commit e015ce8

Please sign in to comment.